Elaztek Developer Hub
Blamite Game Engine - Strings  00402.09.29.23.0627.blamite
A library containing general purpose utilities and classes for use in multiple projects.
switches.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 
24 {
25  std::string name = "unknown";
26  std::string value = "";
27 };
28 
37 {
44  STRINGS_API void ParseSwitches(int args_count, char* args[]);
45 
51  STRINGS_API std::vector<BlamCommandSwitch> GetActiveSwitches();
52 
60  STRINGS_API bool IsSwitchPresent(std::string switch_name);
61 
71  STRINGS_API std::vector<std::string> GetSwitchArguments(std::string switch_name);
72 
81  STRINGS_API std::string GetSwitchValue(std::string switch_name);
82 }
logger.h
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:136
BlamCommandSwitch
Structure representing a command-line switch.
Definition: switches.h:23
BlamStrings::Settings::Switches::ParseSwitches
STRINGS_API void ParseSwitches(int args_count, char *args[])
Parses command-line switches from the initial variables from main().
Definition: switches.cpp:8
BlamStrings::Settings::Switches::GetActiveSwitches
STRINGS_API std::vector< BlamCommandSwitch > GetActiveSwitches()
Retrieves the list of loaded command-line switches.
Definition: switches.cpp:63
string.h
switches.h
BlamStrings::Logger::LogEvent
STRINGS_API void LogEvent(BlamBasicLogMessage message)
Logs an event to the logger.
Definition: logger.cpp:41
BlamStrings::Settings::Switches::GetSwitchArguments
STRINGS_API std::vector< std::string > GetSwitchArguments(std::string switch_name)
Retrieves the list of arguments provided for the specified switch.
Definition: switches.cpp:85
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:7
BlamStrings::Utils::String::ToLower
STRINGS_API std::string ToLower(std::string string)
Transforms a string to all-lowercase.
Definition: string.cpp:76
BlamCommandSwitch::value
std::string value
The value provided to the switch. Will be an empty string if no value was provided.
Definition: switches.h:26
BlamCommandSwitch::name
std::string name
The name of the switch, excluding the - prefix.
Definition: switches.h:25
BlamStrings::Settings::Switches
Namespace containing things relating to command-line switches.
Definition: switches.h:36
active_switches
std::vector< BlamCommandSwitch > active_switches
Definition: switches.cpp:6
BlamStrings::Settings::Switches::IsSwitchPresent
STRINGS_API bool IsSwitchPresent(std::string switch_name)
Determines if a given switch has been passed to the engine.
Definition: switches.cpp:68
STRINGS_API
#define STRINGS_API
Definition: switches.h:9
uuids::to_string
std::basic_string< CharT, Traits, Allocator > to_string(uuid const &id)
Definition: uuid.h:581
BlamStrings::Settings::Switches::GetSwitchValue
STRINGS_API std::string GetSwitchValue(std::string switch_name)
Retrieves the value of a switch.
Definition: switches.cpp:106
BlamLogLevel::Warning
@ Warning
Indicates a warning message. Not something critical, but something that could cause unexpected behavi...