Aegis  4.25.D505
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
xml_node_iso_3166 Class Reference

#include <iso_3166.h>

Inheritance diagram for xml_node_iso_3166:
xml_node

Public Member Functions

virtual ~xml_node_iso_3166 ()
 xml_node_iso_3166 ()
bool need_setup (void)
bool is_a_valid_code (const nstring &code_name) const

Protected Member Functions

void element_begin (const nstring &name)
void attribute (const nstring &name, const nstring &value)
void element_end (const nstring &name)

Private Types

typedef std::map< nstring,
nstring
codes_t

Private Member Functions

void assign (const nstring &key, const nstring &value)
 xml_node_iso_3166 (const xml_node_iso_3166 &)
xml_node_iso_3166operator= (const xml_node_iso_3166 &)

Private Attributes

codes_t codes
nstring alpha_2_code
nstring alpha_3_code

Detailed Description

The xml_node_iso_3166 class is used to represent the data in the iso-3166 data in /usr/share/xml/iso-codes/iso_3166.cml file from the "iso-codes" Debian package.

Definition at line 33 of file iso_3166.h.


Member Typedef Documentation

typedef std::map<nstring, nstring> xml_node_iso_3166::codes_t [private]

Definition at line 76 of file iso_3166.h.


Constructor & Destructor Documentation

The destructor.

The default constructor.

The copy constructor. Do not use.


Member Function Documentation

void xml_node_iso_3166::assign ( const nstring key,
const nstring value 
) [private]

The assign method is used to insert data into the codes instance variable.

Parameters:
keyThe left hand side of the assignment.
valueThe right hand side of the assignment.
void xml_node_iso_3166::attribute ( const nstring name,
const nstring value 
) [protected, virtual]

The attribute method is called for XML_READER_TYPE_ATTRIBUTE nodes. The default action is to do nothing.

Reimplemented from xml_node.

void xml_node_iso_3166::element_begin ( const nstring name) [protected, virtual]

The element_begin method is called for XML_READER_TYPE_ELEMENT nodes. The default action is to do nothing.

Reimplemented from xml_node.

void xml_node_iso_3166::element_end ( const nstring name) [protected, virtual]

The element_end method is called for XML_READER_TYPE_END_ELEMENT nodes. The default action is to do nothing.

Reimplemented from xml_node.

bool xml_node_iso_3166::is_a_valid_code ( const nstring code_name) const

The is_a_valid_code method is used to determien whether the given text is a value country code.

Parameters:
code_nameThe country code candidate
Returns:
true if the text is a valid country code, false if not.

The need_setup method is used to determine whether or not this data needs to be read in from the XML file. It will only ever return "true" once.

xml_node_iso_3166& xml_node_iso_3166::operator= ( const xml_node_iso_3166 ) [private]

The assignment operator. Do not use.


Field Documentation

The alpha_2_code instance variable is used to remember the 2-letter country code, a temporary used when parsing a <iso_3166_entry/> element.

Definition at line 89 of file iso_3166.h.

The alpha_3_code instance variable is used to remember 3-letter country code, a temporary used when parsing a <iso_3166_entry/> element.

Definition at line 96 of file iso_3166.h.

The codes instance variable is used to remember the cumulative code mappings read from the XML file.

Definition at line 82 of file iso_3166.h.


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