Blamite Game Engine - Blam (Core)
converters.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <string>
6 
7 #ifndef BLAM
8 #define BLAM
9 #endif
10 
11 #define bstof(x) Blam::Converters::StringToFloat(x);
12 #define bstod(x) Blam::Converters::StringToDouble(x);
13 #define bstoi(x) Blam::Converters::StringToInt(x);
14 
15 namespace Blam
16 {
20  namespace Converters
21  {
29  std::wstring ConvertStringToWstring(std::string string);
30 
40  std::string WstringToString(std::wstring wide_string);
41 
57  bool StringToBool(std::string string);
58 
69  bool HexStringToChar(std::string hex, char* character);
70 
78  float StringToFloat(std::string string);
79 
87  int StringToInt(std::string string);
88 
96  double StringToDouble(std::string string);
97 
106  std::string BytesToString(void* bytes, int bytes_length);
107  }
108 }
Blam
Namespace surrounding all major engine components.
Definition: blam_api.h:17
Blam::Converters::StringToDouble
double StringToDouble(std::string string)
Converts a string representation of a double to a double.
Definition: converters.cpp:146
string.h
Blam::Converters::ConvertStringToWstring
std::wstring ConvertStringToWstring(std::string string)
Converts a String to a Wide String.
Definition: converters.cpp:10
Blam::Converters::StringToBool
bool StringToBool(std::string string)
Converts a string to a boolean.
Definition: converters.cpp:56
Blam::Converters::StringToInt
int StringToInt(std::string string)
Converts a string representation of an integer to an int.
Definition: converters.cpp:128
Blam::Converters::WstringToString
std::string WstringToString(std::wstring wide_string)
Converts a Wide String to a String.
Definition: converters.cpp:34
Blam::Converters::BytesToString
std::string BytesToString(void *bytes, int bytes_length)
Converts a series of bytes to a string.
Definition: converters.cpp:164
Blam::Converters::HexStringToChar
bool HexStringToChar(std::string hex, char *character)
Converts a hexadecimal code to its respective character.
Definition: converters.cpp:74
Blam::Converters::StringToFloat
float StringToFloat(std::string string)
Converts a string representation of a float to a float.
Definition: converters.cpp:110