4 #include <boost/tokenizer.hpp>
12 std::ifstream
input(filename.c_str());
18 while (getline(
input, buffer)) {
29 while (getline(std::cin, line)) {
40 if(result[0] ==
'"' || result[0] ==
'\'') {
47 int lastpos = result.size()-1;
48 if(result[lastpos] ==
'"' || result[lastpos] ==
'\'') {
49 result.erase(lastpos, 1);
56 std::vector<std::string>
58 typedef boost::char_separator<char> separator_t;
59 typedef boost::tokenizer<separator_t> tokenizer_t;
61 std::vector<std::string>
result;
62 separator_t sep(separator.c_str(),
"", boost::keep_empty_tokens);
63 tokenizer_t tokens(input, sep);
64 copy_all(tokens, std::back_inserter<std::vector<std::string> >(result));
std::string read_whole_file(std::string const &filename)
only does the yacc interpretation
static std::string const input
std::vector< std::string > tokenize(std::string const &input, std::string const &separator)
breaks the input string into tokens, delimited by the separator
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
void read_from_cin(std::string &output)
std::string withoutQuotes(std::string const &from)