Skip to content

StructuredValue

#include "StructuredValue.h"

The format of structured values is defined in the Structured Values document.

class StructuredArray

Represents an array of structured values.

DEFINITION
class StructuredArray;

constructor StructuredArray

DEFINITION
StructuredArray ( Tokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer

method begin

DEFINITION
std::vector< std::shared_ptr< StructuredValue > >::iterator  begin ( );
RETURNSDESCRIPTION
std::vector< std::shared_ptr< StructuredValue > >::iterator

method beginconst

DEFINITION
std::vector< std::shared_ptr< StructuredValue > >::const_iterator  begin ( ) const;
RETURNSDESCRIPTION
std::vector< std::shared_ptr< StructuredValue > >::const_iterator

method emptyconst

DEFINITION
bool  empty ( ) const;
RETURNSDESCRIPTION
bool

method end

DEFINITION
std::vector< std::shared_ptr< StructuredValue > >::iterator  end ( );
RETURNSDESCRIPTION
std::vector< std::shared_ptr< StructuredValue > >::iterator

method endconst

DEFINITION
std::vector< std::shared_ptr< StructuredValue > >::const_iterator  end ( ) const;
RETURNSDESCRIPTION
std::vector< std::shared_ptr< StructuredValue > >::const_iterator

method operator[]const

DEFINITION
std::shared_ptr< StructuredValue >  operator[] ( size_t  index ) const;
PARAMETERDESCRIPTION
index
RETURNSDESCRIPTION
std::shared_ptr< StructuredValue >

method sizeconst

DEFINITION
size_t  size ( ) const;
RETURNSDESCRIPTION
size_t

method typeconstvirtual

DEFINITION
virtual Type  type ( ) const;
RETURNSDESCRIPTION
Type

member entries

DEFINITION
std::vector< std::shared_ptr< StructuredValue > >  entries;

class StructuredBody

Represents a body as part of a structured value.

DEFINITION
class StructuredBody;

constructor StructuredBody

DEFINITION
StructuredBody ( Tokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer

method typeconstvirtual

DEFINITION
virtual Type  type ( ) const;
RETURNSDESCRIPTION
Type

member body

DEFINITION
Body  body;

class StructuredDictionary

Represents a dictionary of structured values. Keys are tokens and values are structured values.

DEFINITION
class StructuredDictionary;

constructor StructuredDictionary

DEFINITION
StructuredDictionary ( Tokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer

method begin

DEFINITION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::iterator  begin ( );
RETURNSDESCRIPTION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::iterator

method beginconst

DEFINITION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::const_iterator  begin ( ) const;
RETURNSDESCRIPTION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::const_iterator

method end

DEFINITION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::iterator  end ( );
RETURNSDESCRIPTION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::iterator

method endconst

DEFINITION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::const_iterator  end ( ) const;
RETURNSDESCRIPTION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >::const_iterator

method get_optionalconst

DEFINITION
std::shared_ptr< StructuredValue >  get_optional ( const Token & token ) const;
PARAMETERDESCRIPTION
token
RETURNSDESCRIPTION
std::shared_ptr< StructuredValue >

method has_keyconst

DEFINITION
bool  has_key ( const Token & token ) const;
PARAMETERDESCRIPTION
token
RETURNSDESCRIPTION
bool

method operator[]const

DEFINITION
std::shared_ptr< StructuredValue >  operator[] ( const Token & token ) const;
PARAMETERDESCRIPTION
token
RETURNSDESCRIPTION
std::shared_ptr< StructuredValue >

method typeconstvirtual

DEFINITION
virtual Type  type ( ) const;
RETURNSDESCRIPTION
Type

member entries

DEFINITION
std::unordered_map< Token, std::shared_ptr< StructuredValue > >  entries;

class StructuredScalar

Represents a scalar value, which can be a single token or a list of tokens.

DEFINITION
class StructuredScalar;

constructor StructuredScalar

DEFINITION
StructuredScalar ( Tokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer

method begin

DEFINITION
std::vector< Token >::iterator  begin ( );
RETURNSDESCRIPTION
std::vector< Token >::iterator

method beginconst

DEFINITION
std::vector< Token >::const_iterator  begin ( ) const;
RETURNSDESCRIPTION
std::vector< Token >::const_iterator

method emptyconst

DEFINITION
bool  empty ( ) const;
RETURNSDESCRIPTION
bool

method end

DEFINITION
std::vector< Token >::iterator  end ( );
RETURNSDESCRIPTION
std::vector< Token >::iterator

method endconst

DEFINITION
std::vector< Token >::const_iterator  end ( ) const;
RETURNSDESCRIPTION
std::vector< Token >::const_iterator

method operator[]const

DEFINITION
const Token & operator[] ( size_t  index ) const;
PARAMETERDESCRIPTION
index
RETURNSDESCRIPTION
const Token &

method sizeconst

DEFINITION
size_t  size ( ) const;
RETURNSDESCRIPTION
size_t

method tokenconst

DEFINITION
const Token & token ( ) const;
RETURNSDESCRIPTION
const Token &

method typeconstvirtual

DEFINITION
virtual Type  type ( ) const;
RETURNSDESCRIPTION
Type

member tokens

DEFINITION
std::vector< Token >  tokens;

class StructuredValue

Represents a structured value, which can be an scalar, array, dictionary, or body.

DEFINITION
class StructuredValue;

enum Type

DEFINITION
enum Type;
VALUEDESCRIPTION
ARRAY
BODY
DICTIONARY
SCALAR_LIST
SCALAR_SINGULAR

destructor ~StructuredValuevirtual

DEFINITION
virtual ~StructuredValue ( );

method as_arrayconst

DEFINITION
const StructuredArray * as_array ( ) const;
RETURNSDESCRIPTION
const StructuredArray *

method as_bodyconst

DEFINITION
const StructuredBody * as_body ( ) const;
RETURNSDESCRIPTION
const StructuredBody *

method as_dictionaryconst

DEFINITION
const StructuredDictionary * as_dictionary ( ) const;
RETURNSDESCRIPTION
const StructuredDictionary *

method as_scalarconst

DEFINITION
const StructuredScalar * as_scalar ( ) const;
RETURNSDESCRIPTION
const StructuredScalar *

method as_singular_scalarconst

DEFINITION
const StructuredScalar * as_singular_scalar ( ) const;
RETURNSDESCRIPTION
const StructuredScalar *

method initializestatic

DEFINITION
static void  initialize ( );

method is_arrayconst

DEFINITION
bool  is_array ( ) const;
RETURNSDESCRIPTION
bool

method is_bodyconst

DEFINITION
bool  is_body ( ) const;
RETURNSDESCRIPTION
bool

method is_dictionaryconst

DEFINITION
bool  is_dictionary ( ) const;
RETURNSDESCRIPTION
bool

method is_scalarconst

DEFINITION
bool  is_scalar ( ) const;
RETURNSDESCRIPTION
bool

method is_singular_scalarconst

DEFINITION
bool  is_singular_scalar ( ) const;
RETURNSDESCRIPTION
bool

method parsestatic

DEFINITION
static std::shared_ptr< StructuredValue >  parse ( Tokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer
RETURNSDESCRIPTION
std::shared_ptr< StructuredValue >

method setupstatic

DEFINITION
static void  setup ( FileTokenizer & tokenizer );
PARAMETERDESCRIPTION
tokenizer

method typeconstvirtual

DEFINITION
virtual Type  type ( ) const = 0;
RETURNSDESCRIPTION
Type

member initializedstatic

DEFINITION
static bool  initialized;

member location

DEFINITION
Location  location;

member start_groupstatic

DEFINITION
static TokenGroup  start_group;