Public Member Functions | Private Attributes

schema_validation::class_key Class Reference

class_key is used to save the information about one key. More...

#include <tag.hpp>

Collaboration diagram for schema_validation::class_key:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 class_key ()
 class_key (const std::string &name, const std::string &type, const std::string &def="\"\"")
 class_key (const config &)
const std::string & get_name () const
const std::string & get_type () const
const std::string & get_default () const
bool is_mandatory () const
void set_name (const std::string &name)
void set_type (const std::string &type)
void set_default (const std::string &def)
void set_mandatory (bool mandatory)
void print (std::ostream &os, int level) const
 is used to print key info the format is next [key] name="name" type="type" default="default" mandatory="true/false" [/key]
bool operator< (const class_key &k) const
 Compares keys by name.

Private Attributes

std::string name_
 Name of key.
std::string type_
 Type of key.
std::string default_
 Default value.
bool mandatory_
 Shows, if key is a mandatory key.

Detailed Description

class_key is used to save the information about one key.

Key has next info: name, type, default value or key is mandatory.

Definition at line 38 of file tag.hpp.


Constructor & Destructor Documentation

schema_validation::class_key::class_key (  )  [inline]

Definition at line 40 of file tag.hpp.

schema_validation::class_key::class_key ( const std::string &  name,
const std::string &  type,
const std::string &  def = "\"\"" 
) [inline]

Definition at line 42 of file tag.hpp.

schema_validation::class_key::class_key ( const config cfg  ) 

Definition at line 40 of file tag.cpp.

References default_, config::has_attribute(), and mandatory_.

Here is the call graph for this function:


Member Function Documentation

const std::string& schema_validation::class_key::get_default (  )  const [inline]

Definition at line 59 of file tag.hpp.

References default_.

const std::string& schema_validation::class_key::get_name (  )  const [inline]

Definition at line 53 of file tag.hpp.

References name_.

Referenced by schema_validation::class_tag::add_key(), and operator<().

Here is the caller graph for this function:

const std::string& schema_validation::class_key::get_type (  )  const [inline]

Definition at line 56 of file tag.hpp.

References type_.

Referenced by schema_validation::schema_validator::validate_key().

Here is the caller graph for this function:

bool schema_validation::class_key::is_mandatory (  )  const [inline]

Definition at line 62 of file tag.hpp.

References mandatory_.

Referenced by print().

Here is the caller graph for this function:

bool schema_validation::class_key::operator< ( const class_key k  )  const [inline]

Compares keys by name.

Used in std::sort, i.e.

Definition at line 95 of file tag.hpp.

References get_name().

Here is the call graph for this function:

void schema_validation::class_key::print ( std::ostream &  os,
int  level 
) const

is used to print key info the format is next [key] name="name" type="type" default="default" mandatory="true/false" [/key]

Definition at line 54 of file tag.cpp.

References default_, is_mandatory(), name_, and type_.

Here is the call graph for this function:

void schema_validation::class_key::set_default ( const std::string &  def  )  [inline]

Definition at line 72 of file tag.hpp.

References default_, and mandatory_.

void schema_validation::class_key::set_mandatory ( bool  mandatory  )  [inline]

Definition at line 78 of file tag.hpp.

References mandatory_.

void schema_validation::class_key::set_name ( const std::string &  name  )  [inline]

Definition at line 66 of file tag.hpp.

References name_.

void schema_validation::class_key::set_type ( const std::string &  type  )  [inline]

Definition at line 69 of file tag.hpp.

References type_.


Member Data Documentation

Default value.

Definition at line 104 of file tag.hpp.

Referenced by class_key(), get_default(), print(), and set_default().

Shows, if key is a mandatory key.

Definition at line 106 of file tag.hpp.

Referenced by class_key(), is_mandatory(), set_default(), and set_mandatory().

std::string schema_validation::class_key::name_ [private]

Name of key.

Definition at line 100 of file tag.hpp.

Referenced by get_name(), print(), and set_name().

std::string schema_validation::class_key::type_ [private]

Type of key.

Definition at line 102 of file tag.hpp.

Referenced by get_type(), print(), and set_type().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:25:50 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs