QuestWeaver
A procedural quest generator
|
Classes | |
struct | weave::EnumClassHash |
Operator to enable the use of enums as keys in maps. More... | |
Functions | |
std::string | weave::htmlEncloseWithTag (const std::string &str, const std::string &tag, const std::vector< std::string > &classes) noexcept |
Encloses a given string with an HTML tag and adds the given classes as "class" attribute. More... | |
std::string | weave::htmlEncloseWithTag (const std::string &str, const std::string &tag) noexcept |
Encloses a given string with an HTML tag. More... | |
std::string | weave::htmlEncloseWithTag (const std::string &str, const std::string &tag, const std::string &cssClass) noexcept |
Encloses a given string with an HTML tag and adds the given CSS class. More... | |
Json::Value | weave::readJsonFromFile (const char *fileName, const Directories &dirs) |
Reads and parses the given file as JSON. More... | |
bool | weave::replace (std::string *str, const std::string &from, const std::string &to) noexcept |
Replaces the first occurrence of a given string with another string. More... | |
void | weave::replaceAll (std::string *str, const std::string &from, const std::string &to) noexcept |
Replaces all occurrences of a given string with another string. More... | |
|
noexcept |
Encloses a given string with an HTML tag and adds the given classes as "class" attribute.
str | The string to enclose with the tag |
tag | The HTML tag to use |
classes | A list of CSS classes for the new tag |
|
noexcept |
Encloses a given string with an HTML tag.
str | The string to enclose with the tag |
tag | The HTML tag to use |
|
noexcept |
Encloses a given string with an HTML tag and adds the given CSS class.
str | The string to enclose with the tag |
tag | The HTML tag to use |
class | The CSS class for the new tag |
Json::Value weave::readJsonFromFile | ( | const char * | fileName, |
const Directories & | dirs | ||
) |
Reads and parses the given file as JSON.
The file is searched for (in this order) in the following directories: mod directory, template directory, current working directory. If the file is not found then a ContractFailedException is thrown. Other exceptions can be thrown when a parsing error or file handling error occurs.
fileName | the fileName of the file to open. |
dirs | the directories to search the file in. |
|
noexcept |
Replaces the first occurrence of a given string with another string.
str | The string that will be modified. |
from | This string will be searched in the "str" parameter. |
to | This string will be used to replace the "from" parameter. |
|
noexcept |
Replaces all occurrences of a given string with another string.
str | The string that will be modified. |
from | This string will be searched in the "str" parameter. |
to | This string will be used to replace the "from" parameter. |