1#include "data_format.h"
3#include <cgv/utils/tokenizer.h>
20 if (description.empty()) {
26 size_t p = description.find_first_of(
']');
27 if (p == std::string::npos) {
33 std::string sub_descr = description.substr(p+1);
34 std::vector<token> toks;
36 if (toks.size() < 3) {
41 last_error =
"format description not terminated by <)>";
55 last_error =
"expected <(> to define dimensions";
58 if (++i == toks.size()) {
64 int n, ld = di, a = 1;
66 last_error =
"expected integer after <(> or <,>";
70 if (i+1 < toks.size()) {
79 if (i+1 < toks.size()) {
93 last_error =
"expected <,> after definition of dimension";
102 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
108 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
114 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
121 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
129 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
137 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
145 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
154 unsigned a,
unsigned d0,
unsigned d1,
unsigned d2,
unsigned d3)
299 return !(*
this == df);
the tokenizer allows to split text into tokens in a convenient way.
tokenizer & set_sep(const std::string &sep, bool merge)
set the list of separators and specify whether succeeding separators are merged into single tokens
ComponentFormat
define standard formats, which should be used to avoid wrong assignment of component names
std::ostream & operator<<(std::ostream &os, const component_format &cf)
stream out operator writes the component format in the syntax of description strings as defined in th...
namespace for templates that provide type information
TypeId
ids for the different types and type constructs
namespace that holds tools that dont fit any other namespace
std::string to_string(const std::string &v, unsigned int w, unsigned int p, bool)
specialization of conversion from string to strings
bool is_integer(const char *begin, const char *end, int &value)
check if the text range (begin,end( defines an integer value. If yes, store the value in the passed r...
Helper functions to process strings.