6
6
#include < sdsl/cst_sct3.hpp>
7
7
8
8
using namespace sdsl ;
9
- using namespace std ;
10
9
11
10
std::string format (" %3I%3S %3s %3P %3p %3L %3B %T" );
12
11
std::string header (" i SA ISA PSI LF LCP BWT TEXT" );
@@ -19,19 +18,19 @@ typedef cst_sct3<csa_int_t> cst_int_t;
19
18
20
19
void print_usage (char const * command)
21
20
{
22
- cout << " \
21
+ std:: cout << " \
23
22
A pretty printer for suffix array/tree members.\n \
24
23
Transforms each input line into a CST and outputs\n \
25
24
formatted suffix array/tree members.\n \
26
25
Usage: " << command
27
- << " X \" [FORMAT]\" \" [HEADER]\" \" [SENTINEL]\"\n \
26
+ << " X \" [FORMAT]\" \" [HEADER]\" \" [SENTINEL]\"\n \
28
27
X : Input is interpreted dependent on X.\n \
29
28
X=1: byte sequence.\n \
30
29
X=d: sequence of decimal numbers.\n \
31
30
FORMAT : Format string. Default=`"
32
- << format << " `.\n \
31
+ << format << " `.\n \
33
32
HEADER : Header string. Default=`"
34
- << header << " `.\n \
33
+ << header << " `.\n \
35
34
SENTINEL: Sentinel character. \n \
36
35
\n \
37
36
Each line of the output will be formatted according to the format string.\
@@ -68,24 +67,24 @@ int main(int argc, char * argv[])
68
67
{
69
68
header = argv[3 ];
70
69
}
71
- while (cin.getline (line, BUF_SIZE))
70
+ while (std:: cin.getline (line, BUF_SIZE))
72
71
{
73
- cout << header << endl;
72
+ std:: cout << header << std:: endl;
74
73
if (' 1' == argv[1 ][0 ])
75
74
{
76
75
cst_byte_t cst;
77
76
construct_im (cst, (char const *)line, 1 );
78
- stringstream ss;
77
+ std:: stringstream ss;
79
78
csXprintf (ss, format, cst, ((argc > 4 ) ? argv[4 ][0 ] : ' $' ));
80
79
std::string line (ss.str ());
81
- cout << std::regex_replace (line, std::regex (R"( \$)" ), " \\ $" ) << endl;
80
+ std:: cout << std::regex_replace (line, std::regex (R"( \$)" ), " \\ $" ) << std:: endl;
82
81
}
83
82
else if (' d' == argv[1 ][0 ])
84
83
{
85
84
cst_int_t cst;
86
85
construct_im (cst, (char const *)line, ' d' );
87
- csXprintf (cout, format, cst, ((argc > 4 ) ? argv[4 ][0 ] : ' 0' ));
86
+ csXprintf (std:: cout, format, cst, ((argc > 4 ) ? argv[4 ][0 ] : ' 0' ));
88
87
}
89
- cout << endl;
88
+ std:: cout << std:: endl;
90
89
}
91
90
}
0 commit comments