UNIVERS
15.3
UNIVERS base processing software API
|
#include <TextRepres.hpp>
Public Member Functions | |
TextRepres () | |
void | set_enlarge_dim_mode (bool bMayEnlarge) |
bool | get_enlarge_dim_mode () const |
virtual char * | check_string (const char *s, int *pDim=NULL) const =0 |
virtual char * | from_string (const char *s)=0 |
virtual char * | to_string () const =0 |
operator char * () const | |
Protected Attributes | |
bool | bEnlargeMode |
Generic class for objects with enabled textual representation. So, to text and from text converters must be implemented plus checking for right syntax. Several utility mthods are implemented.
TextRepres::TextRepres | ( | ) |
Simply setup 'no enlarge' mode.
|
pure virtual |
Check the string for right parsing and return NULL in case of syntax error or pointer just after the last parsed character in case of success. Optional number may be returned if a dimension of parsed data may be needed.
Implemented in AnyValue.
|
pure virtual |
Convert text string to predefined value. ERROR__BAD_SYNTAX is thrown in case of syntax error. Returns the pointer to the first character that can't be parsed.
Implemented in AnyValue.
bool TextRepres::get_enlarge_dim_mode | ( | ) | const |
Get hint of enlargment policy while parsing text representation of the value.
|
inline |
Synonymous to to_string method.
void TextRepres::set_enlarge_dim_mode | ( | bool | bMayEnlarge | ) |
Allow or reject the object to enlarge dimension in case of text parsed value is large than the object may input.
|
pure virtual |
Convert the value into text string. Dynamic string allocation takes place. Returned string must be free(). NULL means the value can't be converted to string for some reason.
Implemented in AnyValue.
|
protected |
Flag of enlarging the object when parsing the textual data representation.