BWAPI
|
#include <Strings.h>
Public Member Functions | |
template<class Type > | |
std::string | getBinary (Type value) |
Static Public Member Functions | |
static std::string | intToString (long value) |
static unsigned long | stringToInt (const std::string &input, const unsigned long begin=0, const int distance=9) |
static std::string | stringToVariableName (const std::string &input) |
static void | stringToFile (const std::string &input, FILE *f) |
static void | saveToFile (const std::string &input, const std::string &fileName) |
static bool | beginsWithNumber (const std::string &input) |
static bool | endsWithNumber (const std::string &input) |
static std::string | loadFromFile (FILE *f) |
static void | loadFromFile (const std::string &fileName, std::string &Target, const long bufferSize) |
static std::string | UTF8ToWindows1250 (const std::string &input) |
static std::string | Windows1250ToUTF8 (const std::string &input) |
static std::string | trimAll (std::string input) |
static std::string | trim (std::string input) |
static std::string | replace (const std::string &input, MultiString *values, const std::string &replacement) |
static RectangleArray< char > | makeBorder (const RectangleArray< char > &input, bool coordinates=true) |
static void | makeWindow (RectangleArray< char > &input, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int frameType=0) |
static void | printTo (RectangleArray< char > &input, const std::string &text, unsigned int x, unsigned int y) |
static std::string | readLine (FILE *f) |
static const std::string & | dereferenceString (const std::string *const input) |
static std::vector< std::string > | splitString (const std::string &input, const std::string &delimiters=" \t") |
static void | skipSpace (const std::string &text, size_t &position) |
static std::string | readWord (const std::string &text, size_t &position) |
static std::string | readNumber (const std::string &text, size_t &position) |
static std::string | ssprintf (const char *format,...) |
Static Public Attributes | |
static char | FrameCharacters [2][6] |
Collection of std::string utilities
bool Util::Strings::beginsWithNumber | ( | const std::string & | input | ) | [static] |
const std::string & Util::Strings::dereferenceString | ( | const std::string *const | input | ) | [static] |
bool Util::Strings::endsWithNumber | ( | const std::string & | input | ) | [static] |
std::string Util::Strings::getBinary | ( | Type | value | ) |
std::string Util::Strings::intToString | ( | long | value | ) | [static] |
Gets textual representation of the specified number.
value | Number to be converted to std::string. |
std::string Util::Strings::loadFromFile | ( | FILE * | f | ) | [static] |
void Util::Strings::loadFromFile | ( | const std::string & | fileName, |
std::string & | Target, | ||
const long | bufferSize | ||
) | [static] |
RectangleArray< char > Util::Strings::makeBorder | ( | const RectangleArray< char > & | input, |
bool | coordinates = true |
||
) | [static] |
void Util::Strings::makeWindow | ( | RectangleArray< char > & | input, |
unsigned int | x, | ||
unsigned int | y, | ||
unsigned int | width, | ||
unsigned int | height, | ||
unsigned int | frameType = 0 |
||
) | [static] |
void Util::Strings::printTo | ( | RectangleArray< char > & | input, |
const std::string & | text, | ||
unsigned int | x, | ||
unsigned int | y | ||
) | [static] |
std::string Util::Strings::readLine | ( | FILE * | f | ) | [static] |
Reads one line from the input stream.
f | Input stream. |
std::string Util::Strings::readNumber | ( | const std::string & | text, |
size_t & | position | ||
) | [static] |
std::string Util::Strings::readWord | ( | const std::string & | text, |
size_t & | position | ||
) | [static] |
Reads words consting of alphaNumeric characters
static std::string Util::Strings::replace | ( | const std::string & | input, |
MultiString * | values, | ||
const std::string & | replacement | ||
) | [static] |
void Util::Strings::saveToFile | ( | const std::string & | input, |
const std::string & | fileName | ||
) | [static] |
void Util::Strings::skipSpace | ( | const std::string & | text, |
size_t & | position | ||
) | [static] |
std::vector< std::string > Util::Strings::splitString | ( | const std::string & | input, |
const std::string & | delimiters = " \t" |
||
) | [static] |
convert input string into vector of string tokens.
input | string to be parsed |
delimiters | list of delimiters. I was too lazy and took it from http://www.rosettacode.org/wiki/Tokenizing_A_String |
std::string Util::Strings::ssprintf | ( | const char * | format, |
... | |||
) | [static] |
void Util::Strings::stringToFile | ( | const std::string & | input, |
FILE * | f | ||
) | [static] |
unsigned long Util::Strings::stringToInt | ( | const std::string & | input, |
const unsigned long | begin = 0 , |
||
const int | distance = 9 |
||
) | [static] |
Converts textual representation of number to number.
input | String containing number representation. |
begin | Position of the first caracter of the number in the input std::string. |
distance | Maximum count of characters to read. |
ParseException | if the text can't be converted to integer (non-numerical characters) |
std::string Util::Strings::stringToVariableName | ( | const std::string & | input | ) | [static] |
std::string Util::Strings::trim | ( | std::string | input | ) | [static] |
std::string Util::Strings::trimAll | ( | std::string | input | ) | [static] |
static std::string Util::Strings::UTF8ToWindows1250 | ( | const std::string & | input | ) | [static] |
static std::string Util::Strings::Windows1250ToUTF8 | ( | const std::string & | input | ) | [static] |
char Util::Strings::FrameCharacters [static] |
{ { char(205), char(186), char(201), char(187), char(200), char(188) }, { char(196), char(179), char(218), char(191), char(192), char(217) } }