BWAPI
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Static Public Attributes
Util::Strings Class Reference

#include <Strings.h>

List of all members.

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]

Detailed Description

Collection of std::string utilities


Member Function Documentation

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]
template<class Type >
std::string Util::Strings::getBinary ( Type  value)
std::string Util::Strings::intToString ( long  value) [static]

Gets textual representation of the specified number.

Parameters:
valueNumber to be converted to std::string.
Returns:
Textual representation of the specified number.

Here is the caller graph for this function:

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]

Here is the call graph for this function:

void Util::Strings::makeWindow ( RectangleArray< char > &  input,
unsigned int  x,
unsigned int  y,
unsigned int  width,
unsigned int  height,
unsigned int  frameType = 0 
) [static]

Here is the call graph for this function:

Here is the caller graph for this function:

void Util::Strings::printTo ( RectangleArray< char > &  input,
const std::string &  text,
unsigned int  x,
unsigned int  y 
) [static]

Here is the caller graph for this function:

std::string Util::Strings::readLine ( FILE *  f) [static]

Reads one line from the input stream.

Parameters:
fInput stream.
Returns:
Content of the line.
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.

Note:
consecutive delimiters will be treated as single delimiter
delimiters are _not_ included in return data
Parameters:
inputstring to be parsed
delimiterslist of delimiters. I was too lazy and took it from http://www.rosettacode.org/wiki/Tokenizing_A_String

Here is the caller graph for this function:

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.

Parameters:
inputString containing number representation.
beginPosition of the first caracter of the number in the input std::string.
distanceMaximum count of characters to read.
Returns:
Returns textual representation of the specified std::string.
Exceptions:
ParseExceptionif 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]

Member Data Documentation

Initial value:
 
  {
    {
      char(205),
      char(186),
      char(201),
      char(187),
      char(200),
      char(188)
    },
    {
      char(196),
      char(179),
      char(218),
      char(191),
      char(192),
      char(217)
    }
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines