Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Tag Class Reference

class representing a html tag. More...

#include <tag.h>

Inheritance diagram for Tag::

CharClose CharOpen DefineClose DefineOpen DeleteClose DeleteOpen Function HookTag Image Include Init Lang LevelTag Link Locale LocaleClose Macro MenuBase MenuClose ScriptEnd ScriptStart SimpleTag SitemapBase List of all members.

Public Methods

 Tag (std::string tag, bool no_warning_check=false)
 something like "<menu name="main">". More...

 Tag (Line &line, bool no_warning_check=false)
 Tag ()
bool operator! () const
 class not a tag?;. More...

bool get_option (const std::string which, std::string &result)
 returns the specific string to the option. More...

template<class T> bool get_option (const std::string which, T &result)
bool get_option (const std::string which)
 checks for flag options. More...

template<class T> bool set_option (const std::string o, const T f, bool ff=false)
bool set_option (const std::string option, const std::string flag="", bool fail_if_set=false)
std::string get_tag () const
 returns the whole tag. More...

std::string get_tag_type () const
 returns something like "menu". More...

void set_tag_type (std::string type)
 changes the tag type. More...

Line get_line () const
void rebuild_tag ()
 reconstructs the tag. More...

void delete_option (const std::string option)
 deletes an option. More...

void delete_default_options ()
std::string get_options ()
 returns a string with all options. More...

int get_number_of_options ()
bool get_option (int number, std::string &option, std::string &value)
 returns the n'th option. More...

bool get_option (int number, std::string &value)
 returns the value of a specific option. More...

int get_level (bool guess_it=false)
 Tag (std::string tag, bool no_warning_check=false)
 something like "<menu name="main">". More...

 Tag (Line &line, bool no_warning_check=false)
 Tag ()
bool operator! () const
 class not a tag?;. More...

bool get_option (const std::string which, std::string &result)
 returns the specific string to the option. More...

template<class T> bool get_option (const std::string which, T &result)
bool get_option (const std::string which)
 checks for flag options. More...

template<class T> bool set_option (const std::string o, const T f, bool ff=false)
bool set_option (const std::string option, const std::string flag="", bool fail_if_set=false)
std::string get_tag () const
 returns the whole tag. More...

std::string get_tag_type () const
 returns something like "menu". More...

void set_tag_type (std::string type)
 changes the tag type. More...

Line get_line () const
void rebuild_tag ()
 reconstructs the tag. More...

void delete_option (const std::string option)
 deletes an option. More...

void delete_default_options ()
std::string get_options ()
 returns a string with all options. More...

int get_number_of_options ()
bool get_option (int number, std::string &option, std::string &value)
 returns the n'th option. More...

bool get_option (int number, std::string &value)
 returns the value of a specific option. More...

int get_level (bool guess_it=false)

Protected Types

typedef std::list< Optionoptions_list
typedef options_list::iterator options_list_it
typedef std::list< Optionoptions_list
typedef options_list::iterator options_list_it

Protected Attributes

options_list options
bool is_valid_tag
bool options_extracted
 extract options on demand. More...

bool no_warning_check
 checks if there is a "no_warning" option in the tag to suppress warnings. More...

bool nowarning

Private Methods

bool is_tag ()
 checks if it is an tag. More...

void extract_options ()
 extracts all options. More...

void extract_type ()
 extracts the tag_type. More...

void split_option (std::string option, std::string &name, std::string &value)
 extracts the name and value of an option string. More...

bool check_if_valid ()
bool is_tag ()
 checks if it is an tag. More...

void extract_options ()
 extracts all options. More...

void extract_type ()
 extracts the tag_type. More...

void split_option (std::string option, std::string &name, std::string &value)
 extracts the name and value of an option string. More...

bool check_if_valid ()

Private Attributes

std::string tag_type
Line line
bool got_line
bool searched_level
int level

Detailed Description

class representing a html tag.

Note: the name of the "</menu>" tag would be "/menu"


Member Typedef Documentation

typedef std::list<Option> Tag::options_list [protected]
 

typedef std::list<Option> Tag::options_list [protected]
 

typedef options_list::iterator Tag::options_list_it [protected]
 

typedef options_list::iterator Tag::options_list_it [protected]
 


Constructor & Destructor Documentation

Tag::Tag std::string    tag,
bool    no_waring_check = false
 

something like "<menu name="main">".

Tag::Tag Line   line,
bool    no_warning_check = false
 

Tag::Tag   [inline]
 

Tag::Tag std::string    tag,
bool    no_waring_check = false
 

something like "<menu name="main">".

Tag::Tag Line   line,
bool    no_warning_check = false
 

Tag::Tag   [inline]
 


Member Function Documentation

bool Tag::check_if_valid   [inline, private]
 

bool Tag::check_if_valid   [inline, private]
 

void Tag::delete_default_options   [inline]
 

Reimplemented in FileLink, and Image.

void Tag::delete_default_options   [inline]
 

Reimplemented in FileLink, and Image.

void Tag::delete_option const std::string    option
 

deletes an option.

void Tag::delete_option const std::string    option
 

deletes an option.

void Tag::extract_options   [private]
 

extracts all options.

void Tag::extract_options   [private]
 

extracts all options.

void Tag::extract_type   [private]
 

extracts the tag_type.

void Tag::extract_type   [private]
 

extracts the tag_type.

int Tag::get_level bool    guess_it = false
 

searches for the level option and returns it's value. If it can't be found it returns the default value 0. If guess_it is set to true, the function will find the correct level at this <delete 1> tag too. But be careful!

int Tag::get_level bool    guess_it = false
 

searches for the level option and returns it's value. If it can't be found it returns the default value 0. If guess_it is set to true, the function will find the correct level at this <delete 1> tag too. But be careful!

Line Tag::get_line   const [inline]
 

Reimplemented in DefineOpen, SimpleTag, and Locale.

Line Tag::get_line   const [inline]
 

Reimplemented in DefineOpen, SimpleTag, and Locale.

int Tag::get_number_of_options   [inline]
 

int Tag::get_number_of_options   [inline]
 

bool Tag::get_option int    number,
std::string &    value
[inline]
 

returns the value of a specific option.

bool Tag::get_option int    number,
std::string &    option,
std::string &    value
[inline]
 

returns the n'th option.

bool Tag::get_option const std::string    o [inline]
 

checks for flag options.

Reimplemented in FileLink.

template<class T>
bool Tag::get_option const std::string    which,
T &    result
[inline]
 

bool Tag::get_option const std::string    o,
std::string &    s
 

returns the specific string to the option.

if the tag is <menu name="blah"> and you call get_option( "name" ) it returns "blah". If the option is not set the function returns false and if the option is set, but contains no string an empty string is returned

Reimplemented in FileLink.

bool Tag::get_option int    number,
std::string &    value
[inline]
 

returns the value of a specific option.

bool Tag::get_option int    number,
std::string &    option,
std::string &    value
[inline]
 

returns the n'th option.

bool Tag::get_option const std::string    o [inline]
 

checks for flag options.

Reimplemented in FileLink.

template<class T>
bool Tag::get_option const std::string    which,
T &    result
[inline]
 

bool Tag::get_option const std::string    o,
std::string &    s
 

returns the specific string to the option.

if the tag is <menu name="blah"> and you call get_option( "name" ) it returns "blah". If the option is not set the function returns false and if the option is set, but contains no string an empty string is returned

Reimplemented in FileLink.

std::string Tag::get_options  
 

returns a string with all options.

Reimplemented in FileLink.

std::string Tag::get_options  
 

returns a string with all options.

Reimplemented in FileLink.

std::string Tag::get_tag   const [inline]
 

returns the whole tag.

Reimplemented in Macro.

std::string Tag::get_tag   const [inline]
 

returns the whole tag.

Reimplemented in Macro.

std::string Tag::get_tag_type   const [inline]
 

returns something like "menu".

Reimplemented in FileLink, and MenuBase.

std::string Tag::get_tag_type   const [inline]
 

returns something like "menu".

Reimplemented in FileLink, and MenuBase.

bool Tag::is_tag   [private]
 

checks if it is an tag.

bool Tag::is_tag   [private]
 

checks if it is an tag.

bool Tag::operator!   const [inline]
 

class not a tag?;.

Reimplemented in CharOpen, CharClose, DefineOpen, DefineClose, DeleteOpen, DeleteClose, FileLink, FileList, Image, Include, Init, Lang, Locale, LocaleClose, Macro, MenuBase, MenuClose, ScriptStart, ScriptEnd, Function, SitemapBase, and Link.

bool Tag::operator!   const [inline]
 

class not a tag?;.

Reimplemented in CharOpen, CharClose, DefineOpen, DefineClose, DeleteOpen, DeleteClose, FileLink, FileList, Image, Include, Init, Lang, Locale, LocaleClose, Macro, MenuBase, MenuClose, ScriptStart, ScriptEnd, Function, SitemapBase, and Link.

void Tag::rebuild_tag  
 

reconstructs the tag.

void Tag::rebuild_tag  
 

reconstructs the tag.

bool Tag::set_option const std::string    option,
const std::string    flag = "",
bool    fail_if_set = false
 

if fail_if_set is true the function returns false if there is already an option with the same name.

template<class T>
bool Tag::set_option const std::string    o,
const T    f,
bool    ff = false
[inline]
 

bool Tag::set_option const std::string    option,
const std::string    flag = "",
bool    fail_if_set = false
 

if fail_if_set is true the function returns false if there is already an option with the same name.

template<class T>
bool Tag::set_option const std::string    o,
const T    f,
bool    ff = false
[inline]
 

void Tag::set_tag_type std::string    type [inline]
 

changes the tag type.

do not forget to reconstruct the tag after calling this function

void Tag::set_tag_type std::string    type [inline]
 

changes the tag type.

do not forget to reconstruct the tag after calling this function

void Tag::split_option std::string    option,
std::string &    name,
std::string &    value
[private]
 

extracts the name and value of an option string.

void Tag::split_option std::string    option,
std::string &    name,
std::string &    value
[private]
 

extracts the name and value of an option string.


Member Data Documentation

bool Tag::got_line [private]
 

bool Tag::is_valid_tag [protected]
 

Reimplemented in Include, Locale, LocaleClose, Macro, MenuBase, MenuClose, SitemapBase, and Link.

int Tag::level [private]
 

Reimplemented in DefineOpen, and LevelTag.

Line Tag::line [private]
 

bool Tag::no_warning_check [protected]
 

checks if there is a "no_warning" option in the tag to suppress warnings.

this is required by the image, file and filelist tag

bool Tag::nowarning [protected]
 

options_list Tag::options [mutable, protected]
 

bool Tag::options_extracted [protected]
 

extract options on demand.

bool Tag::searched_level [private]
 

std::string Tag::tag_type [private]
 

Reimplemented in MenuBase.


The documentation for this class was generated from the following files:
Generated on Tue Nov 20 02:19:54 2001 for Leo<HTML> by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001