conversions.h File Reference

#include <string>
#include <sstream>

Include dependency graph for conversions.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string itos (int i)
template<class T>
std::string xtos (const T &t)
 Conver anything that has << to string.
std::string iptos (unsigned long ip)
bool try_get_double (const std::string &value, double &f)
bool try_get_bool (const std::string &value, bool &b)
bool try_get_long (const std::string &value, long &i)
bool try_get_char (const std::string &value, unsigned char &c)
long get_long (const std::string &value)
 die on error
double get_double (const std::string &value)
bool get_bool (const std::string &value)
unsigned char get_char (const std::string &value)
void utf8tows (const char *utf8, std::wstring &ws)
 Convert UTF-8 string to wchar_t string.
void wstoutf8 (const std::wstring &ws, std::string &utf8)
 Convert wchar_t strinf to UTF-8 string.


Function Documentation

bool get_bool const std::string &  value  ) 
 

unsigned char get_char const std::string &  value  ) 
 

double get_double const std::string &  value  ) 
 

long get_long const std::string &  value  ) 
 

die on error

std::string iptos unsigned long  ip  ) 
 

convert int with IP address to string ip is in network byte order

Definition at line 20 of file conversions.cpp.

std::string itos int  i  ) 
 

convert integer to string

Definition at line 12 of file conversions.cpp.

bool try_get_bool const std::string &  value,
bool &  b
 

bool try_get_char const std::string &  value,
unsigned char &  c
 

bool try_get_double const std::string &  value,
double &  f
 

bool try_get_long const std::string &  value,
long &  i
 

void utf8tows const char *  utf8,
std::wstring &  ws
 

Convert UTF-8 string to wchar_t string.

Parameters:
utf8 input string encoded in utf-8
ws output string

Definition at line 140 of file conversions.cpp.

References LOGE.

Referenced by Console::addConsoleMessage(), Translator::loadFile(), FontFTGL::RenderUTF8(), and Translator::translateW().

void wstoutf8 const std::wstring &  ws,
std::string &  utf8
 

Convert wchar_t strinf to UTF-8 string.

Parameters:
ws input string containing wchar_t string
utf8 output string encoded in UTF-8

Definition at line 281 of file conversions.cpp.

References appendW().

Referenced by Console::addConsoleMessage(), and InputString::updateCachedStrings().

Here is the call graph for this function:

template<class T>
std::string xtos const T &  t  ) 
 

Conver anything that has << to string.

Returns:
converted value

Definition at line 23 of file conversions.h.

Referenced by FontManager::get(), and Console::render().


Generated on Wed Apr 12 13:57:20 2006 for bjs by  doxygen 1.4.5