Vaca::String Class Reference

#include <String.h>

List of all members.


Detailed Description

A string of characters.

It is a std::basic_string<Character> with some extra methods, but this class doesn't have extra data members.

Public Member Functions

 String ()
 String (int length)
 String (const String &str)
 String (const VACA_STRING_BASE &str)
 String (const char *str)
 String (const char *str, int length)
 String (const wchar_t *str)
virtual ~String ()
Stringtrim ()
std::string to_string () const
std::wstring to_wstring () const
 Converts the String to a new a string with wide-characters (std::wstring).
void copyTo (LPTSTR dest, int size) const
 Commondly used to give strings to Win32 API or from Win32 API (in structures and messages).
int parseInt (int base=10) const
double parseDouble () const
String getFilePath () const
 Returns the file path (the path of "C:\foo\main.cpp" is "C:\foo" without the file name).
String getFileName () const
 Returns the file name (the file name of "C:\foo\main.cpp" is "main.cpp", without the path).
String getFileExtension () const
 Returns the file extension (the extension of "C:\foo\main.cpp" is "cpp", without the path and its title).
String getFileTitle () const
 Returns the file title (the title of "C:\foo\main.cpp" is "main", without the path and without the extension).
String addPathComponent (const String &component) const
String getUrlHost () const
String getUrlObject () const

Static Public Member Functions

static String trim (const String &str)
static String format (const char *fmt,...)
static String format (const wchar_t *fmt,...)
static String fromInt (int value, int base=10, int precision=0)
static String fromDouble (double value, int precision)


Constructor & Destructor Documentation

String::String (  ) 

String::String ( int  length  )  [explicit]

String::String ( const String str  ) 

String::String ( const VACA_STRING_BASE &  str  ) 

String::String ( const char *  str  ) 

String::String ( const char *  str,
int  length 
)

String::String ( const wchar_t *  str  ) 

String::~String (  )  [virtual]


Member Function Documentation

String & String::trim (  ) 

String String::trim ( const String str  )  [static]

String String::format ( const char *  fmt,
  ... 
) [static]

String String::format ( const wchar_t *  fmt,
  ... 
) [static]

std::string String::to_string (  )  const

Todo:
docme

std::wstring String::to_wstring (  )  const

Converts the String to a new a string with wide-characters (std::wstring).

If Vaca was compiled without the Unicode support (it is that String is just ASCII), it converts the string to wstring using the Win32 routine MultiByteToWideChar.

void String::copyTo ( LPTSTR  dest,
int  size 
) const

Commondly used to give strings to Win32 API or from Win32 API (in structures and messages).

String String::fromInt ( int  value,
int  base = 10,
int  precision = 0 
) [static]

int String::parseInt ( int  base = 10  )  const

String String::fromDouble ( double  value,
int  precision 
) [static]

double String::parseDouble (  )  const

String String::getFilePath (  )  const

Returns the file path (the path of "C:\foo\main.cpp" is "C:\foo" without the file name).

See also:
getFileName

String String::getFileName (  )  const

Returns the file name (the file name of "C:\foo\main.cpp" is "main.cpp", without the path).

See also:
getFilePath, getFileTitle

String String::getFileExtension (  )  const

Returns the file extension (the extension of "C:\foo\main.cpp" is "cpp", without the path and its title).

Warning:
For a file name like "pack.tar.gz" the extension is "gz".
See also:
getFilePath, getFileTitle

String String::getFileTitle (  )  const

Returns the file title (the title of "C:\foo\main.cpp" is "main", without the path and without the extension).

Warning:
For a file name like "pack.tar.gz" the title is "pack.tar".
See also:
getFilePath, getFileExtension

String String::addPathComponent ( const String component  )  const

String String::getUrlHost (  )  const

String String::getUrlObject (  )  const