4 #include <boost/tokenizer.hpp> 27 while (getline(std::cin,
line)) {
44 int lastpos =
result.size() - 1;
53 typedef boost::char_separator<char> separator_t;
54 typedef boost::tokenizer<separator_t> tokenizer_t;
56 std::vector<std::string>
result;
57 separator_t sep(
separator.c_str(),
"", boost::keep_empty_tokens);
58 tokenizer_t tokens(
input, sep);
59 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
static std::string const separator(":")
void read_from_cin(std::string &output)
std::string withoutQuotes(std::string const &from)