all repos — fluxbox @ 955c2358fbd8364be5629504cc720e0a9227d630

custom fork of the fluxbox windowmanager

testing menu parser
fluxgen fluxgen
commit

955c2358fbd8364be5629504cc720e0a9227d630

parent

e5c0b02496e5d332174a27b607079a397c6d313b

1 files changed, 31 insertions(+), 0 deletions(-)

jump to
A src/tests/parsertest.cc

@@ -0,0 +1,31 @@

+#include "../FbMenuParser.hh" + +#include <iostream> + +using namespace std; + + +int main(int argc, char **argv) { + if (argc < 2) { + cerr<<"you must supply an argument!"<<endl; + exit(0); + } + cerr<<"Loading: "<<argv[1]<<endl; + Parser *p = new FbMenuParser(argv[1]); + if (!p->isLoaded()) { + cerr<<"Couldn't load file: "<<argv[1]<<endl; + delete p; + exit(0); + } + + Parser::Item item, item2, item3; + int args = 0; + int last_line_num = 0; + std::string last_line; + std::string type, name, argument; + while (!p->eof()) { + (*p)>>item>>item2>>item3; + cerr<<item.second<<","<<item2.second<<", "<<item3.second<<endl; + } + delete p; +}