Core Library
Namespaces | Functions
StringUtils.hpp File Reference

Utility functions for formatting strings. More...

#include <stdarg.h>

Namespaces

namespace  Core
 

The Core Library namespace.


Functions

tstring Core::fmtEx (const tchar *pszFormat, va_list args)
 Format the string ala printf.
tstring Core::fmt (const tchar *pszFormat,...)
 Format the string ala printf.
template<typename First , typename Last >
First Core::skipWhitespace (First first, Last last)
 Skip any leading whitespace.
template<typename T >
tstring Core::format (const T &value)
 Format a value into a string.
template<>
tstring Core::format (const bool &value)
 Format a boolean value into a string.
template<>
tstring Core::format (const int &value)
 Format a signed integer value into a string.
template<>
tstring Core::format (const uint &value)
 Format an unsigned integer value into a string.
template<>
tstring Core::format (const longlong &value)
 Format a signed long long integer value into a string.
template<>
tstring Core::format (const ulonglong &value)
 Format a unsigned long long integer value into a string.
template<typename T >
Core::parse (const tstring &buffer)
 Parse a boolean value from a string.
template<>
bool Core::parse (const tstring &buffer)
 Parse a boolean value from a string.
void Core::makeUpper (tstring &string)
 Convert a string to upper case.
tstring Core::createUpper (tstring string)
 Create an upper case version of a string.
void Core::makeLower (tstring &string)
 Convert a string to lower case.
tstring Core::createLower (tstring string)
 Create a lower case version of a string.
void Core::trimLeft (tstring &string)
 Trim any leading whitespace from the string.
void Core::trimRight (tstring &string)
 Trim any trailing whitespace from the string.
void Core::trim (tstring &string)
 Trim any leading or trailing whitespace from the string.
tstring Core::trimCopy (tstring string)
 Trim any leading or trailing whitespace from a copy of the string.
size_t strnlen (const char *string, size_t bufsize)
 Get the length of a string, using the current locale or one that has been passed in.
size_t wcsnlen (const wchar_t *string, size_t bufsize)
 Get the length of a string, using the current locale or one that has been passed in.

Detailed Description

Utility functions for formatting strings.

Author:
Chris Oldwood

Function Documentation

size_t strnlen ( const char *  string,
size_t  bufsize 
)

Get the length of a string, using the current locale or one that has been passed in.

More secure versions of strlen().

size_t wcsnlen ( const wchar_t *  string,
size_t  bufsize 
)

Get the length of a string, using the current locale or one that has been passed in.

More secure versions of strlen().