#include <string>
#include <deque>
#include <iostream>
#include <fstream>
#include <map>

#include "tokenizer.h"

string trim(const string& s, const string& trimchars = " \t") {
  if(s.length() == 0)
    return s;
  int b = s.find_first_not_of(trimchars);
  int e = s.find_last_not_of(trimchars);
  if(b == -1) // No non-spaces
    return "";
  return string(s, b, e - b + 1);
}

template <class T, class chartype>
inline basic_string<chartype> toTString(const T& t) {
 basic_ostringstream<chartype> o;
 o << t;
 return o.str();
}

template <class T>
inline string toString(const T& t) {
 return toTString<T,char>(t);
}

template <class T>
inline wstring toWString(const T& t) {
 return toTString<T,wchar_t>(t);
}

int main( int argc, char *argv[] )
{
	if( argc != 2 )
	{
		cerr << "give filename" << endl;
		return -1;
	}

	ifstream infile( argv[1] );
	string delims( ";" );
	
	while( infile.good() && !infile.eof() )
	{
		string line;

		getline( infile, line );

		if( !line.size() )
			continue;

		deque<string> tokens;
		tokenize( line, delims, tokens );
		
		//tokens.size()
		//string &str = tokens[x];
		
		
	}
}

