70 std::string separators;
71 bool merge_separators;
72 std::string begin_skip;
74 std::string escape_skip;
75 std::string whitespaces;
77 bool handle_skip(
token& result);
78 bool handle_separators(
token& result,
bool check_skip=
true);
79 bool reverse_handle_skip(
token& result);
80 bool reverse_handle_separators(
token& result,
bool check_skip=
true);
95 tokenizer&
set_skip(
const std::string& open,
const std::string& close,
const std::string& escape);
115 bool balanced_bite(
token& result,
const std::string& open_parenthesis,
const std::string& close_parenthesis,
bool wait_for_sep =
false);
117 void bite_all(std::vector<token>& result);
126#include <cgv/config/lib_end.h>
the tokenizer allows to split text into tokens in a convenient way.
void skip_whitespaces()
skip whitespaces at the front
void reverse_skip_whitespaces()
skip whitespaces at the back
tokenizer & set_sep(const std::string &sep, bool merge)
set the list of separators and specify whether succeeding separators are merged into single tokens
tokenizer & set_sep_merge(bool merge)
specify whether succeeding separators are merged into single tokens
tokenizer & set_ws(const std::string &ws)
set the list of white spaces, that separate tokens and are skipped
bool skip_ws_check_empty()
skip whitespaces at the front and return whether the complete text has been processed
bool reverse_skip_ws_check_empty()
skip whitespaces at the back and return whether the complete text has been processed
token bite()
bite away a single token from the front
token reverse_bite()
bite away a single token from the back
tokenizer()
construct empty tokenizer
tokenizer & set_skip(const std::string &open, const std::string &close)
set several character pairs that enclose tokens that are not split
namespace that holds tools that dont fit any other namespace
void bite_all(tokenizer &t, std::vector< token > &result)
bite all tokens into a token vector
this header is dependency free
representation of a token in a text by two pointers begin and end, that point to the first character ...
bool empty() const
return whether the token is empty
token()
construct with both pointers set to 0