31#ifndef CFGFILE__TAG_NO_VALUE_HPP__INCLUDED
32#define CFGFILE__TAG_NO_VALUE_HPP__INCLUDED
40#if defined( CFGFILE_QT_SUPPORT ) && defined( CFGFILE_XML_SUPPORT )
42#include <QDomDocument>
54template<
typename Trait =
string_trait_t >
56 :
public tag_t< Trait >
78 typename Trait::string_t
print(
int indent = 0 )
const override
80 typename Trait::string_t
result;
84 result.append(
typename Trait::string_t(
indent,
95 result.append(
tag->print(
indent + 1 ) );
108#if defined( CFGFILE_QT_SUPPORT ) && defined( CFGFILE_XML_SUPPORT )
135 if(
tag->is_mandatory() && !
tag->is_defined() )
137 Trait::from_ascii(
"Undefined child mandatory tag: \"" ) +
139 Trait::from_ascii(
"\". Where parent is: \"" ) +
141 Trait::from_ascii(
"\". In file \"" ) +
info.file_name() +
142 Trait::from_ascii(
"\" on line " ) +
143 Trait::to_string(
info.line_number() ) +
144 Trait::from_ascii(
"." ) );
152 const typename Trait::string_t &
str )
override
155 this->
name() + Trait::from_ascii(
"\" doesn't allow any values. "
156 "But we've got this: \"" ) +
157 str + Trait::from_ascii(
"\". In file \"" ) +
info.file_name() +
158 Trait::from_ascii(
"\" on line " ) +
159 Trait::to_string(
info.line_number() ) +
160 Trait::from_ascii(
"." ) );
Exception in the library.
Definition exceptions.hpp:51
Tag without a value.
Definition tag_no_value.hpp:57
void on_string(const parser_info_t< Trait > &info, const typename Trait::string_t &str) override
Called when string found.
Definition tag_no_value.hpp:151
Trait::string_t print(int indent=0) const override
Print tag to the output.
Definition tag_no_value.hpp:78
void on_finish(const parser_info_t< Trait > &info) override
Called when tag parsing finished.
Definition tag_no_value.hpp:131
void print(QDomDocument &doc, QDomElement *parent=0) const override
Print tag to the output.
Definition tag_no_value.hpp:110
tag_no_value_t(const typename Trait::string_t &name, bool is_mandatory=false)
Construct tag.
Definition tag_no_value.hpp:60
tag_no_value_t(tag_t< Trait > &owner, const typename Trait::string_t &name, bool is_mandatory=false)
Construct tag.
Definition tag_no_value.hpp:67
~tag_no_value_t()
Definition tag_no_value.hpp:73
Base class for the tags in the configuration file.
Definition tag.hpp:58
void set_defined(bool on=true)
Set "defined" property.
Definition tag.hpp:164
bool is_mandatory() const
Definition tag.hpp:146
bool is_defined() const
Definition tag.hpp:152
const tag_t< Trait > * parent() const
Definition tag.hpp:134
virtual const child_tags_list_t & children() const
Definition tag.hpp:182
const Trait::string_t & name() const
Definition tag.hpp:140