test_parser.cpp
Go to the documentation of this file.
00001 /*
00002  * test_parser.cpp
00003  *
00004  *  Created on: Nov 24, 2013
00005  *      Author: dan
00006  */
00007 
00008 
00009 #include <iostream>
00010 #include <sstream>
00011 #include <vector>
00012 using namespace std;
00013 
00014 vector<string> split(string text, char del=':'){
00015         stringstream in(text);
00016         vector<string> res;
00017         char ch;
00018         while(in.eof()==false){
00019                 in >> ch;
00020                 stringstream word;
00021                 while(in.eof()==false and ch!=del){
00022                         word << ch;
00023                         in >> ch;
00024                 }
00025                 if(word.str().size()>0)
00026                         res.push_back(word.str());
00027         }
00028         return res;
00029 }
00030 
00031 int main(int argc, char** argv){
00032 
00033         cout<<"Start Parser"<<endl;
00034         string exe ( argv[0] );
00035         string project( argv[1] );
00036         vector<string> files = split(string(argv[2]));
00037 
00038         cout<<"parser path: "<<exe<<endl;
00039         cout<<"project folder: "<<project<<endl;
00040         cout<<"files"<<endl;
00041         for(size_t i=0;i<files.size();i++){
00042                 cout<<"    "<<i<<") "<<files[i]<<endl;
00043         }
00044 
00045         cout<<"End parser"<<endl;
00046         return 0;
00047 }
00048 
00049 
00050 
00051 


decision_making_parser
Author(s):
autogenerated on Wed Aug 26 2015 11:16:57