Elaztek Developer Hub
Blamite Game Engine - Strings  00367.02.08.23.1815.blamite
A library containing general purpose utilities and classes for use in multiple projects.
string.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #ifdef STRINGS_EXPORTS
7 #define STRINGS_API __declspec(dllexport)
8 #else
9 #define STRINGS_API __declspec(dllimport)
10 #endif
11 
12 #define str_tolower(str) BlamStrings::Utils::String::ToLower(str);
13 #define str_toupper(str) BlamStrings::Utils::String::ToUpper(str);
14 
15 namespace BlamStrings
16 {
17  namespace Utils
18  {
22  namespace String
23  {
33  STRINGS_API bool StartsWith(std::string string, std::string starts_with, bool case_insensetive = false);
34 
44  STRINGS_API bool StartsWithAny(std::string string, std::vector<std::string> starts_with, bool case_insensetive = false);
45 
55  STRINGS_API bool EndsWith(std::string string, std::string ends_with, bool case_insensetive = false);
56 
66  STRINGS_API bool EndsWithAny(std::string string, std::vector<std::string> ends_with, bool case_insensetive = false);
67 
77  STRINGS_API std::string Replace(std::string orig, std::string to_replace, std::string replace_with);
78 
86  STRINGS_API std::string ToLower(std::string string);
87 
95  STRINGS_API std::string ToUpper(std::string string);
96 
104  STRINGS_API std::string FixDirectorySeparators(std::string string);
105 
122  STRINGS_API std::vector<std::string> Split(std::string string, std::string splitter);
123 
132  STRINGS_API bool ContainsChar(std::string string, char contains);
133 
142  STRINGS_API bool Contains(std::string string, std::string contains);
143 
157  STRINGS_API bool MemoryStringCompare(char* address, char* to_compare, int size);
158  }
159  }
160 }
STRINGS_API
#define STRINGS_API
Definition: string.h:9
BlamStrings::Utils::String::Split
STRINGS_API std::vector< std::string > Split(std::string string, std::string splitter)
Splits a string around any instance of a substring.
Definition: string.cpp:113
BlamStrings
Namespace for Blamite's shared C++ library.
Definition: events.h:162
BlamStrings::Utils::String::ToUpper
STRINGS_API std::string ToUpper(std::string string)
Transforms a string to all-uppercase.
Definition: string.cpp:84
BlamStrings::Utils::String::Contains
STRINGS_API bool Contains(std::string string, std::string contains)
Determines whether or not a string contains the specified substring.
Definition: string.cpp:158
BlamStrings::Utils::String::FixDirectorySeparators
STRINGS_API std::string FixDirectorySeparators(std::string string)
Replaces any instance of \\ in a string with /.
Definition: string.cpp:133
BlamStrings::Utils::String::StartsWith
STRINGS_API bool StartsWith(std::string string, std::string starts_with, bool case_insensetive=false)
Determines whether or not a string starts with another string, case-insensetive.
Definition: string.cpp:6
BlamStrings::Utils::String::ToLower
STRINGS_API std::string ToLower(std::string string)
Transforms a string to all-lowercase.
Definition: string.cpp:75
BlamStrings::Utils::String::MemoryStringCompare
STRINGS_API bool MemoryStringCompare(char *address, char *to_compare, int size)
Checks the specified address in memory to see if it matches a given string, ignoring null terminators...
Definition: string.cpp:168
BlamStrings::Utils::String::Replace
STRINGS_API std::string Replace(std::string orig, std::string to_replace, std::string replace_with)
Replaces part of a string with another string.
Definition: string.cpp:93
BlamStrings::Utils::String::EndsWith
STRINGS_API bool EndsWith(std::string string, std::string ends_with, bool case_insensetive=false)
Determines whether or not a string ends with another string, case-sensetive.
Definition: string.cpp:37
BlamStrings::Utils::String::EndsWithAny
STRINGS_API bool EndsWithAny(std::string string, std::vector< std::string > ends_with, bool case_insensetive=false)
Determines whether or not a string ends with any one of multiple possible strings.
Definition: string.cpp:62
BlamConfigurationSettingType::String
@ String
Indicates the setting stores a string.
BlamStrings::Utils::String::StartsWithAny
STRINGS_API bool StartsWithAny(std::string string, std::vector< std::string > starts_with, bool case_insensetive=false)
Determines whether or not a string starts with any one of multiple possible strings.
Definition: string.cpp:24
BlamStrings::Utils::String::ContainsChar
STRINGS_API bool ContainsChar(std::string string, char contains)
Determines whether or not a string contains the specified character.
Definition: string.cpp:142