24 token(
const char* _str);
26 token(
const char* _b,
const char* _e);
28 token(
const std::string& s);
30 size_t get_length()
const;
36 void skip(
const std::string& skip_chars);
38 void reverse_skip(
const std::string& skip_chars);
40 char operator [] (
unsigned int i)
const;
42 bool operator == (
const char* s)
const;
44 bool operator == (
const std::string& s)
const;
46 bool operator != (
const char* s)
const;
48 bool operator != (
const std::string& s)
const;
62inline std::vector<std::string>
to_strings(
const std::vector<token>::const_iterator first,
const std::vector<token>::const_iterator last) {
63 std::vector<std::string> strs;
68inline std::vector<std::string>
to_strings(
const std::vector<token>& ts) {
72inline std::ostream& operator << (std::ostream& os,
const token& t) {
if (!t.
empty()) os << std::string(t.
begin, t.
get_length());
return os; }
77#include <cgv/config/lib_end.h>
std::vector< std::string > to_strings(const std::vector< token >::const_iterator first, const std::vector< token >::const_iterator last)
convert to strings
std::string to_string(const std::string &v, unsigned int w, unsigned int p, bool)
specialization of conversion from string to strings
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
size_t get_length() const
return the length of the token in number of characters
char operator[](unsigned int i) const
return the i-th character of the token
const char * begin
pointers that define the range of characters
size_t size() const
return the length of the token in number of characters