#include <dmplib.hh>
Inheritance diagram for Tagged:
Public Member Functions | |
Tagged () | |
bool | initialized () const |
void | set_initialized () |
void | unset_initalized () |
Tagged () | |
bool | initialized () const |
void | set_initialized () |
void | unset_initalized () |
Protected Member Functions | |
void | check_start_tag (std::istream &is, const char *tag) |
void | check_end_tag (std::istream &is, const char *tag) |
void | check_start_tag (std::istream &is, const char *tag) |
void | check_end_tag (std::istream &is, const char *tag) |
Private Attributes | |
bool | m_initialized |
Static Private Attributes | |
static std::string | s_saved_tag |
Definition at line 45 of file dmplib.hh.
Tagged::Tagged | ( | ) | [inline] |
Tagged::Tagged | ( | ) | [inline] |
void Tagged::check_end_tag | ( | std::istream & | is, | |
const char * | tag | |||
) | [protected] |
void Tagged::check_end_tag | ( | std::istream & | is, | |
const char * | tag | |||
) | [inline, protected] |
Definition at line 108 of file dmplib.hh.
References deljobs::string.
00109 { 00110 char c; 00111 is >> c; 00112 if(c != '}') 00113 throw AsciiNoEndChar(); 00114 00115 std::string in_tag; 00116 is >> in_tag; 00117 if(in_tag != tag) 00118 throw AsciiWrongEndTag(tag, in_tag); 00119 }
void Tagged::check_start_tag | ( | std::istream & | is, | |
const char * | tag | |||
) | [protected] |
void Tagged::check_start_tag | ( | std::istream & | is, | |
const char * | tag | |||
) | [inline, protected] |
Definition at line 81 of file dmplib.hh.
References set_initialized(), and deljobs::string.
00082 { 00083 // read input, check for '{' character 00084 char c; 00085 if(!(is >> c) || (c != '{')) { 00086 throw AsciiNoStartChar(); 00087 } 00088 00089 // compare tags 00090 std::string in_tag; 00091 is >> in_tag; 00092 if(in_tag != tag) 00093 throw AsciiWrongStartTag(tag, in_tag); 00094 00095 // check for empty block 00096 is >> c; 00097 if(c == '}') { 00098 is >> in_tag; 00099 if(in_tag != tag) 00100 throw AsciiWrongEndTag(tag, in_tag); 00101 } else { 00102 is.putback(c); 00103 set_initialized(); 00104 } 00105 }
bool Tagged::initialized | ( | ) | const |
bool Tagged::initialized | ( | ) | const [inline] |
Definition at line 63 of file dmplib.hh.
References m_initialized.
00064 { 00065 return m_initialized; 00066 }
void Tagged::set_initialized | ( | ) |
void Tagged::set_initialized | ( | ) | [inline] |
Definition at line 69 of file dmplib.hh.
References m_initialized.
Referenced by check_start_tag(), main(), BesAsciiIO::SaveAsciiEvents(), and BesAsciiIO::SaveHitAsciiEvents().
00070 { 00071 m_initialized = true; 00072 }
void Tagged::unset_initalized | ( | ) |
void Tagged::unset_initalized | ( | ) | [inline] |
Definition at line 75 of file dmplib.hh.
References m_initialized.
00076 { 00077 m_initialized = false; 00078 }
bool Tagged::m_initialized [private] |
Definition at line 58 of file dmplib.hh.
Referenced by initialized(), set_initialized(), and unset_initalized().
static std::string Tagged::s_saved_tag [static, private] |