UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | List of all members
TextRepres Class Referenceabstract

#include <TextRepres.hpp>

Inheritance diagram for TextRepres:
AnyValue

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
 

Detailed Description

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.

Constructor & Destructor Documentation

TextRepres::TextRepres ( )

Simply setup 'no enlarge' mode.

Member Function Documentation

virtual char* TextRepres::check_string ( const char *  s,
int *  pDim = NULL 
) const
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.

virtual char* TextRepres::from_string ( const char *  s)
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.

TextRepres::operator char * ( ) const
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.

virtual char* TextRepres::to_string ( ) const
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.

Member Data Documentation

bool TextRepres::bEnlargeMode
protected

Flag of enlarging the object when parsing the textual data representation.


The documentation for this class was generated from the following file: