![]() |
Blamite Game Engine - Strings
00316.05.31.21.2007.blamite
A library containing general purpose utilities and classes for use in multiple projects.
|
#include "xml.h"#include <fstream>#include "components/3rdparty/rapidxml/rapidxml.hpp"#include "components/logger/logger.h"Macros | |
| #define | NEWLINE_MARKER "\n" |
Functions | |
| std::string | GenerateIndentPrefix (int indent_level, int spaces_per_indent) |
| Generates a string prefix for the given indentation level. More... | |
| std::string | GenerateNodeString (rapidxml::xml_node<> *node, int indent_level, int spaces_per_indent) |
| Generates a string for the given XML node. More... | |
| #define NEWLINE_MARKER "\n" |
| std::string GenerateIndentPrefix | ( | int | indent_level, |
| int | spaces_per_indent | ||
| ) |
Generates a string prefix for the given indentation level.
This function is used to generate the indent prefix for formatting XML strings. For instance, if spaces_per_indent is set to 4, and the indent_level is 2, then the resulting string would be 8 spaces.
| indent_level | - The indent level to generate a prefix for. |
| spaces_per_ident | - The number of spaces per indentation level. |
| std::string GenerateNodeString | ( | rapidxml::xml_node<> * | node, |
| int | indent_level, | ||
| int | spaces_per_indent | ||
| ) |
Generates a string for the given XML node.
This will parse all child nodes and attributes as a string. Used for formatting XML strings in a human-readable format.
| node | - The node to generate a string for. |
| indent_level | - The indentation level of node. Children will be indented automatically. |
| spaces_per_indent | - The number of spaces to use per indent level. |