16 int main(
int argc,
char **argv) {
22 string filename = argParser.
get<
string>(
"i",
"data/1998statistics.xml");
23 string outputfolder = argParser.
get<
string>(
"o",
"/tmp");
24 const bool indent = argParser.
isSet(
"p");
31 cout << t.
summary() <<
"; Height: " << height <<
" Avg depth: " << avgDepth << endl;
35 auto pos = filename.find_last_of(
"/\\");
36 string outname = outputfolder +
"/" + filename.substr(pos + 1) +
".stripped";
39 cout <<
"Wrote trimmed XML file in " << timer.
getAndReset() <<
"ms: " << t.
summary() << endl;
42 std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary);
43 auto origSize = in.tellg();
44 std::ifstream in2(outname, std::ifstream::ate | std::ifstream::binary);
45 auto strippedSize = in2.tellg();
48 <<
" file=" << filename
49 <<
" origSize=" << origSize
50 <<
" strippedSize=" << strippedSize
52 <<
" height=" << height
53 <<
" avgDepth=" << avgDepth
int main(int argc, char **argv)
Ordered tree data structure.
bool isSet(const string &arg) const
check whether an argument was set
Read an XML file into a tree, using RapidXml.
Parse command-line arguments.
T get(const string &key, const T defaultValue=T())
string summary() const
A one-line summary of the tree.
XML tree writer (empty template for overloading)
A key-value label storage.