cfgfile 0.2.11
Loading...
Searching...
No Matches
cfgfile::tag_t< Trait > Class Template Referenceabstract

Base class for the tags in the configuration file. More...

#include <tag.hpp>

+ Inheritance diagram for cfgfile::tag_t< Trait >:

Public Types

typedef std::vector< tag_t< Trait > * > child_tags_list_t
 List with children.
 

Public Member Functions

 tag_t (const typename Trait::string_t &name, bool is_mandatory=false)
 Construct tag.
 
 tag_t (tag_t< Trait > &owner, const typename Trait::string_t &name, bool is_mandatory=false)
 Construct tag.
 
virtual ~tag_t ()
 
void add_child (tag_t< Trait > &tag)
 Add child tag.
 
void remove_child (tag_t< Trait > &tag)
 Remove child tag.
 
const tag_t< Trait > * parent () const
 
const Trait::string_t & name () const
 
bool is_mandatory () const
 
bool is_defined () const
 
void set_defined (bool on=true)
 Set "defined" property.
 
Trait::pos_t line_number () const
 
Trait::pos_t column_number () const
 
virtual const child_tags_list_tchildren () const
 
virtual Trait::string_t print (int indent=0) const =0
 Print tag to the output.
 
virtual void print (QDomDocument &doc, QDomElement *parent=0) const =0
 Print tag to the output.
 
virtual void on_start (const parser_info_t< Trait > &info)
 Called when tag parsing started.
 
virtual void on_finish (const parser_info_t< Trait > &info)=0
 Called when tag parsing finished.
 
virtual void on_string (const parser_info_t< Trait > &info, const typename Trait::string_t &str)=0
 Called when string found.
 

Protected Member Functions

void set_parent (const tag_t< Trait > *p)
 Set parent tag.
 
bool is_any_child_defined () const
 
bool is_defined_member_value () const
 

Friends

template<typename T1 >
class parser_t
 
template<class T1 , class T2 >
class tag_vector_of_tags_t
 

Detailed Description

template<typename Trait = string_trait_t>
class cfgfile::tag_t< Trait >

Base class for the tags in the configuration file.

Member Typedef Documentation

◆ child_tags_list_t

template<typename Trait = string_trait_t>
typedef std::vector< tag_t< Trait >* > cfgfile::tag_t< Trait >::child_tags_list_t

List with children.

Constructor & Destructor Documentation

◆ tag_t() [1/2]

template<typename Trait = string_trait_t>
cfgfile::tag_t< Trait >::tag_t ( const typename Trait::string_t &  name,
bool  is_mandatory = false 
)
inlineexplicit

Construct tag.

◆ tag_t() [2/2]

template<typename Trait = string_trait_t>
cfgfile::tag_t< Trait >::tag_t ( tag_t< Trait > &  owner,
const typename Trait::string_t &  name,
bool  is_mandatory = false 
)
inline

Construct tag.

◆ ~tag_t()

template<typename Trait = string_trait_t>
virtual cfgfile::tag_t< Trait >::~tag_t ( )
inlinevirtual

Member Function Documentation

◆ add_child()

template<typename Trait = string_trait_t>
void cfgfile::tag_t< Trait >::add_child ( tag_t< Trait > &  tag)
inline

Add child tag.

◆ children()

template<typename Trait = string_trait_t>
virtual const child_tags_list_t & cfgfile::tag_t< Trait >::children ( ) const
inlinevirtual
Returns
List with children.

Reimplemented in cfgfile::tag_vector_of_tags_t< T, Trait >.

◆ column_number()

template<typename Trait = string_trait_t>
Trait::pos_t cfgfile::tag_t< Trait >::column_number ( ) const
inline
Returns
Column number.

◆ is_any_child_defined()

template<typename Trait = string_trait_t>
bool cfgfile::tag_t< Trait >::is_any_child_defined ( ) const
inlineprotected
Returns
Is any child tag defined?

◆ is_defined()

template<typename Trait = string_trait_t>
bool cfgfile::tag_t< Trait >::is_defined ( ) const
inline
Returns
Is this tag defined?

◆ is_defined_member_value()

template<typename Trait = string_trait_t>
bool cfgfile::tag_t< Trait >::is_defined_member_value ( ) const
inlineprotected
Returns
m_is_defined member value.

◆ is_mandatory()

template<typename Trait = string_trait_t>
bool cfgfile::tag_t< Trait >::is_mandatory ( ) const
inline
Returns
Is this tag mandatory?

◆ line_number()

template<typename Trait = string_trait_t>
Trait::pos_t cfgfile::tag_t< Trait >::line_number ( ) const
inline
Returns
Line number.

◆ name()

template<typename Trait = string_trait_t>
const Trait::string_t & cfgfile::tag_t< Trait >::name ( ) const
inline
Returns
Name of the tag.

◆ on_finish()

◆ on_start()

template<typename Trait = string_trait_t>
virtual void cfgfile::tag_t< Trait >::on_start ( const parser_info_t< Trait > &  info)
inlinevirtual

Called when tag parsing started.

Reimplemented in cfgfile::tag_vector_of_tags_t< T, Trait >.

◆ on_string()

◆ parent()

template<typename Trait = string_trait_t>
const tag_t< Trait > * cfgfile::tag_t< Trait >::parent ( ) const
inline
Returns
Parent tag.

◆ print() [1/2]

◆ print() [2/2]

◆ remove_child()

template<typename Trait = string_trait_t>
void cfgfile::tag_t< Trait >::remove_child ( tag_t< Trait > &  tag)
inline

Remove child tag.

◆ set_defined()

template<typename Trait = string_trait_t>
void cfgfile::tag_t< Trait >::set_defined ( bool  on = true)
inline

Set "defined" property.

◆ set_parent()

template<typename Trait = string_trait_t>
void cfgfile::tag_t< Trait >::set_parent ( const tag_t< Trait > *  p)
inlineprotected

Set parent tag.

Friends And Related Symbol Documentation

◆ parser_t

template<typename Trait = string_trait_t>
template<typename T1 >
friend class parser_t
friend

◆ tag_vector_of_tags_t

template<typename Trait = string_trait_t>
template<class T1 , class T2 >
friend class tag_vector_of_tags_t
friend

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