39 format(
const std::string& f);
const char * meta() const
Characters that need to be escaped.
Print as is. For instance, don't try to escape labels.
Print as a parsable type string.
std::istream & operator>>(std::istream &is, direction &d)
Parsing.
const char * meta_
Additional characters to escape.
format for_labels() const
A copy of this format, but to print labels.
bool operator!=(self_t that) const
format meta(const char *m) const
Set the list of additional meta characters that need to be escaped.
bool is_for_labels() const
Whether to use the syntax for labels (e.g., "a|x").
An input/output format for valuesets.
bool delimit_
Whether we should delimit. E.g., 1, 2 or (1, 2).
bool delimit() const
Whether we should delimit: (1, 2) instead of 1, 2.
std::ostream & operator<<(std::ostream &os, direction d)
Pretty-printing.
bool is_for_weights() const
Whether to use the syntax for weights (e.g., "(1, 1/2)").
std::ostringstream os
The output stream: the corresponding C++ snippet to compile.
bool operator<(self_t that) const
Print as rich UTF-8 text, escaped.
Print as plain (ASCII) text, escaped.
std::string to_string(direction d)
Conversion to string.
format for_weights() const
A copy of this format, but to print weights.
bool label_
Whether printed as a label (e.g., a|x), or as a weight (e.g., (1, 1/2)).
bool operator==(self_t that) const
format delimit(bool d) const
Set whether we should delimit: (1, 2) instead of 1, 2.
By default, print for text.