 |
Blamite Game Engine - Strings
00402.09.29.23.0627.blamite
A library containing general purpose utilities and classes for use in multiple projects.
|
Go to the documentation of this file.
7 #define STRING_TEXT(string_id) BlamStrings::Resources::Strings::LookupString(string_id)
8 #define ERROR_TEXT(error_code) BlamStrings::Resources::Strings::LookupErrorString(error_code)
10 #ifdef STRINGS_EXPORTS
11 #define STRINGS_API __declspec(dllexport)
13 #define STRINGS_API __declspec(dllimport)
53 bool HasAttribute(std::string
id);
64 std::string GetAttribute(std::string
id);
STRINGS_API std::string ParseStringFromXMLValue(std::string string)
Performs a number of modifications and tweaks to a string.
Definition: string.cpp:328
STRINGS_API bool ErrorStringExists(int error_code)
Looks through the list of loaded error strings to see if a given error string has been loaded.
Definition: strings.cpp:265
STRINGS_API int StringToInt(std::string string)
Converts a string representation of an integer to an int.
Definition: converters.cpp:138
STRINGS_API std::map< std::string, BlamEngineString > * GetUniversalStrings()
Retrieves the list of all loaded strings.
Definition: strings.cpp:241
STRINGS_API void LogEvent(BlamBasicLogMessage message)
Logs an event to the logger.
Definition: logger.cpp:41
STRINGS_API bool LoadCommonStrings(std::string base_dir)
Loads the string tables editor_strings, error_strings, shared_strings, and config_strings.
Definition: strings.cpp:117
Namespace containing functions for Blamite string resources.
Definition: strings.h:70
std::vector< BlamEngineString > LoadStringListFromFile(std::string file_path)
Parses a list of strings from a file.
Definition: strings.cpp:76
@ en_US
Definition: strings.h:21
#define STRINGS_API
Definition: strings.h:13
STRINGS_API bool StringExists(std::string id)
Looks through the list of loaded engine strings to see if a given string has been loaded.
Definition: strings.cpp:251
std::map< std::string, BlamEngineString > universal_string_list
Definition: strings.cpp:13
Class representing attribute node of XML document.
Definition: rapidxml.hpp:138
std::string value
The attribute value.
Definition: strings.h:32
std::map< int, BlamEngineString * > error_strings
Map containing a list of all error strings.
Definition: strings.cpp:14
xml_node< Ch > * first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
Gets first child node, optionally matching node name.
Definition: rapidxml.hpp:936
STRINGS_API std::string LookupErrorString(int error_code)
Finds a string message associated with a given error code.
Definition: strings.cpp:227
std::string text
The content of the string.
Definition: strings.h:42
STRINGS_API bool LoadStrings(std::string file_path)
Loads all strings in the given file into the universal string list.
Definition: strings.cpp:129
Structure representing a Blamite string attribute.
Definition: strings.h:29
@ Error
Indicates an error that could cause engine instability.
std::vector< BlamStringAttribute > attributes
The list of attributes present within the string.
Definition: strings.h:44
bool HasAttribute(std::string id)
Checks whether the string has a given attribute.
Definition: BlamEngineString.cpp:3
BlamEngineString ParseString(rapidxml::xml_node<> *string_node)
Parses an XML node into a BlamEngineString.
Definition: strings.cpp:23
This class represents root of the DOM hierarchy.
Definition: rapidxml.hpp:139
STRINGS_API bool FileExists(std::string name)
Checks if the specified file or directory exists.
Definition: io.cpp:26
Class representing a Blamite string.
Definition: strings.h:38
Class representing a node of XML document.
Definition: rapidxml.hpp:137
STRINGS_API bool StringToBool(std::string string)
Converts a string to a boolean.
Definition: converters.cpp:60
BlamLanguage
Enum containing all supported languages within the engine.
Definition: strings.h:19
std::basic_string< CharT, Traits, Allocator > to_string(uuid const &id)
Definition: uuid.h:581
std::string id
The ID of the string.
Definition: strings.h:41
xml_attribute< Ch > * next_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
Gets next attribute, optionally matching attribute name.
Definition: rapidxml.hpp:856
STRINGS_API std::string LookupString(std::string id)
Finds a string with a given ID.
Definition: strings.cpp:213
std::string id
The attribute ID.
Definition: strings.h:31
xml_attribute< Ch > * first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
Gets first attribute of node, optionally matching attribute name.
Definition: rapidxml.hpp:1025
STRINGS_API bool LoadErrorStrings(std::string file_path)
Loads all strings in the given file as error description strings.
Definition: strings.cpp:159
@ Warning
Indicates a warning message. Not something critical, but something that could cause unexpected behavi...
std::string GetAttribute(std::string id)
Retrieves the value of a given attribute.
Definition: BlamEngineString.cpp:16
STRINGS_API std::map< int, BlamEngineString * > * GetErrorStrings()
Retrieves the list of all loaded error code strings.
Definition: strings.cpp:246
void parse(Ch *text)
Parses zero-terminated XML string according to given flags.
Definition: rapidxml.hpp:1381
xml_node< Ch > * next_sibling(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
Gets next sibling node, optionally matching node name.
Definition: rapidxml.hpp:1004