Commit a803ba6bc6efddff73b60d43908ad5fa50d1503f
1 parent
1e3c4bd5
update
Showing
1 changed file
with
13 additions
and
14 deletions
src/xml/GXml.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | * GXml.cpp - XML class implementation * |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2010 by Jurgen Knodlseder * | |
| 4 | + * copyright (C) 2010-2011 by Jurgen Knodlseder * | |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| 6 | 6 | * * |
| 7 | 7 | * This program is free software; you can redistribute it and/or modify * |
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | ***************************************************************************/ |
| 58 | 58 | GXml::GXml(void) |
| 59 | 59 | { |
| 60 | - // Initialise private members for clean destruction | |
| 60 | + // Initialise members | |
| 61 | 61 | init_members(); |
| 62 | 62 | |
| 63 | 63 | // Return |
| ... | ... | @@ -68,11 +68,11 @@ GXml::GXml(void) |
| 68 | 68 | /***********************************************************************//** |
| 69 | 69 | * @brief Copy constructor |
| 70 | 70 | * |
| 71 | - * @param[in] xml Object from which the instance should be built. | |
| 71 | + * @param[in] xml XML object. | |
| 72 | 72 | ***************************************************************************/ |
| 73 | 73 | GXml::GXml(const GXml& xml) |
| 74 | 74 | { |
| 75 | - // Initialise private members for clean destruction | |
| 75 | + // Initialise members | |
| 76 | 76 | init_members(); |
| 77 | 77 | |
| 78 | 78 | // Copy members |
| ... | ... | @@ -86,11 +86,11 @@ GXml::GXml(const GXml& xml) |
| 86 | 86 | /***********************************************************************//** |
| 87 | 87 | * @brief Load constructor |
| 88 | 88 | * |
| 89 | - * @param[in] filename XML file from which object should be constructed. | |
| 89 | + * @param[in] filename XML file name. | |
| 90 | 90 | ***************************************************************************/ |
| 91 | 91 | GXml::GXml(const std::string& filename) |
| 92 | 92 | { |
| 93 | - // Initialise private members for clean destruction | |
| 93 | + // Initialise members | |
| 94 | 94 | init_members(); |
| 95 | 95 | |
| 96 | 96 | // Load XML file |
| ... | ... | @@ -123,7 +123,7 @@ GXml::~GXml(void) |
| 123 | 123 | /***********************************************************************//** |
| 124 | 124 | * @brief Assignment operator |
| 125 | 125 | * |
| 126 | - * @param[in] xml Object which should be assigned. | |
| 126 | + * @param[in] xml XML object. | |
| 127 | 127 | ***************************************************************************/ |
| 128 | 128 | GXml& GXml::operator= (const GXml& xml) |
| 129 | 129 | { |
| ... | ... | @@ -133,7 +133,7 @@ GXml& GXml::operator= (const GXml& xml) |
| 133 | 133 | // Free members |
| 134 | 134 | free_members(); |
| 135 | 135 | |
| 136 | - // Initialise private members for clean destruction | |
| 136 | + // Initialise members | |
| 137 | 137 | init_members(); |
| 138 | 138 | |
| 139 | 139 | // Copy members |
| ... | ... | @@ -203,7 +203,7 @@ void GXml::load(const std::string& filename) |
| 203 | 203 | // Check if file exists |
| 204 | 204 | if (!file_exists(filename)) |
| 205 | 205 | throw GException::file_not_found(G_LOAD, filename); |
| 206 | - | |
| 206 | + | |
| 207 | 207 | // Open parameter file |
| 208 | 208 | FILE* fptr = fopen(filename.c_str(), "r"); |
| 209 | 209 | if (fptr == NULL) |
| ... | ... | @@ -356,7 +356,6 @@ void GXml::copy_members(const GXml& xml) |
| 356 | 356 | ***************************************************************************/ |
| 357 | 357 | void GXml::free_members(void) |
| 358 | 358 | { |
| 359 | - | |
| 360 | 359 | // Return |
| 361 | 360 | return; |
| 362 | 361 | } |
| ... | ... | @@ -414,7 +413,7 @@ void GXml::parse(FILE* fptr) |
| 414 | 413 | else if (c == '>') { |
| 415 | 414 | segment.append(1, (char)c); |
| 416 | 415 | throw GException::xml_syntax_error(G_PARSE, segment, |
| 417 | - "unexpected closing bracket '>' encountered"); | |
| 416 | + "unexpected closing bracket \">\" encountered"); | |
| 418 | 417 | } |
| 419 | 418 | |
| 420 | 419 | // ... otherwise add character to segment |
| ... | ... | @@ -442,7 +441,7 @@ void GXml::parse(FILE* fptr) |
| 442 | 441 | else if (c == '<') { |
| 443 | 442 | segment.append(1, (char)c); |
| 444 | 443 | throw GException::xml_syntax_error(G_PARSE, segment, |
| 445 | - "unexpected opening bracket '<' encountered"); | |
| 444 | + "unexpected opening bracket \"<\" encountered"); | |
| 446 | 445 | } |
| 447 | 446 | |
| 448 | 447 | // ... otherwise add character to segment |
| ... | ... | @@ -504,7 +503,7 @@ void GXml::process_markup(GXmlNode** current, const std::string& segment) |
| 504 | 503 | // Check if we have the correct end tag |
| 505 | 504 | GXmlElement* element = (GXmlElement*)(*current); |
| 506 | 505 | element->parse_stop(segment); |
| 507 | - | |
| 506 | + | |
| 508 | 507 | // Set current node pointer back to parent of the current node |
| 509 | 508 | (*current) = element->parent(); |
| 510 | 509 | } |
| ... | ... | @@ -620,7 +619,7 @@ GXml::MarkupType GXml::get_markuptype(const std::string& segment) const |
| 620 | 619 | { |
| 621 | 620 | // Initialise with invalid Markup Type |
| 622 | 621 | MarkupType type = MT_INVALID; |
| 623 | - | |
| 622 | + | |
| 624 | 623 | // Get length of segment |
| 625 | 624 | int n = segment.length(); |
| 626 | 625 | ... | ... |