P6R::p6ISafeString Interface Reference
[Runtime Interfaces]

This runtime interface provides a set of safe string routines that should be used in place of the standard C runtime string routines. More...

#include <p6runtimeif.h>

Inherits P6R::p6ICom.

List of all members.

Public Member Functions

virtual P6R::P6INT32 addref ()=0
 This method increases the reference count of the component instance by one.
virtual P6R::P6ERR atol (const P6R::P6CHAR *pString, P6R::P6SIZE cchMax, P6R::P6INT32 *pRetLong)=0
 This method converts the string pointed to by pString into a P6R::P6INT32.
virtual P6R::P6ERR atolEx (const P6R::P6CHAR *pString, P6R::P6SIZE cchMax, P6R::P6INT32 *pRetLong, P6R::P6CHAR **ppEndPtr)=0
 This method is an enhanced version of atol() used to convert an ascii number string string into an P6R::P6INT32.
virtual P6R::P6ERR atoll (const P6R::P6CHAR *pString, P6R::P6SIZE cchMax, P6R::P6INT64 *pRetLongLong)=0
 This method converts the string pointed to by pString into a P6R::P6INT64.
virtual P6R::P6ERR atollEx (const P6R::P6CHAR *pString, P6R::P6SIZE cchMax, P6R::P6INT64 *pRetLongLong, P6R::P6CHAR **ppEndPtr)=0
 This method is an enhanced version of atoll() used to convert an ascii number string string into an P6R::P6INT64.
virtual P6R::P6ERR atolW (const P6R::P6WCHAR *pString, P6R::P6SIZE cchMax, P6R::P6INT32 *pRetLong)=0
 This method converts the wide string pointed to by pString into a P6R::P6INT32.
virtual P6R::P6ERR bstrchr (const P6R::P6BCSTR *pbcsStr, P6R::P6INT16 c, P6R::P6BCSTR *pRetPtr)=0
 Finds the first occurance of c in pbcString,.
virtual P6R::P6ERR bstrcmp (const P6R::P6BCSTR *s1, const P6R::P6BCSTR *s2, P6R::P6INT32 *pRetval)=0
 Case-sensitively compares two P6R::P6BCSTR's.
virtual P6R::P6ERR bstricmp (const P6R::P6BCSTR *s1, const P6R::P6BCSTR *s2, P6R::P6INT32 *pRetval)=0
 Case-insensitively compares two P6R::P6BCSTR's.
virtual P6R::P6ERR bstrlcat (P6R::P6CHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6BCSTR *pbsSource, P6R::P6SIZE *pcCopied)=0
 Appends a P6BCSTR onto a normal "C" string.
virtual P6R::P6ERR bstrlcpy (P6R::P6CHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6BCSTR *pbsSource, P6R::P6SIZE *pcCopied)=0
 Copy a P6BCSTR into a character buffer and NULL terminate.
virtual P6R::P6ERR bstrlwr (P6R::P6BSTR *pbsStr)=0
 Converts the specified P6BSTR to lowercase ASCII in-place.
virtual P6R::P6ERR bstrrchr (const P6R::P6BCSTR *pbcsStr, P6R::P6INT16 c, P6R::P6BCSTR *pRetPtr)=0
 Finds the last occurance of c in string,.
virtual P6R::P6ERR bstrsep (P6R::P6BCSTR *pbcsSearchIn, const P6R::P6CHAR *pszDelimiters, P6R::P6BCSTR *pbcsToken)=0
 Extracts a the first token from a string described by a P6BCSTR, where the tokens are delimited by the characters in pszDelimiters.
virtual P6R::P6ERR bstrupr (P6R::P6BSTR *pbsStr)=0
 Converts the specified P6BSTR to uppercase in-place.
virtual P6R::P6ERR bwstrlcpy (P6R::P6WCHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6BWCSTR *pSource)=0
 Copy a P6BWCSTR into a wide character buffer and NULL terminate.
virtual P6R::P6ERR compareMem (const P6R::P6VOID *pMem1, const P6R::P6VOID *pMem2, P6R::P6SIZE nBytes, P6R::P6INT32 *pResult)=0
 Compares bytes in two buffers.
virtual P6R::P6ERR copyMem (P6R::P6VOID *pDest, P6R::P6SIZE cDest, const P6R::P6VOID *pSource, P6R::P6SIZE nBytes)=0
 Copies nBytes from pSource to pDest.
virtual P6R::P6ERR floatToString (P6R::P6FLOAT value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6SIZE *pcWritten)=0
 Convert a P6R::P6FLOAT to a string.
virtual P6R::P6ERR floatToStringW (P6R::P6FLOAT value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6SIZE *pcWritten)=0
 Convert a P6R::P6FLOAT to a wide string.
virtual P6R::P6ERR formatString (P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6SIZE *pcWritten, const P6R::P6CHAR *pszFormat, const P6R::P6ARG *pArgs, P6R::P6SIZE cArgs)=0
 Provides a safer, enhanced snprintf replacement.
virtual P6R::P6ERR formatStringW (P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6SIZE *pcWritten, const P6R::P6WCHAR *pszFormat, const P6R::P6ARG *pArgs, P6R::P6SIZE cArgs)=0
 Provides a safer, enhanced swprintf replacement.
virtual P6R::P6ERR int16ToString (P6R::P6INT16 value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a signed 16 bit integer to a P6CHAR string with the specified radix.
virtual P6R::P6ERR int16ToStringW (P6R::P6INT16 value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a signed 16 bit integer to a P6WCHAR string with the specified radix.
virtual P6R::P6ERR int32ToString (P6R::P6INT32 value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a signed 32 bit integer to a P6CHAR string with the specified radix.
virtual P6R::P6ERR int32ToStringW (P6R::P6INT32 value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a signed 32 bit integer to a P6WCHAR string with the specified radix.
virtual P6R::P6ERR int64ToString (P6R::P6INT64 value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a signed 64 bit integer to a P6CHAR string with the specified radix.
virtual P6R::P6ERR int64ToStringW (P6R::P6INT64 value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a signed 64 bit integer to a P6WCHAR string with the specified radix.
virtual P6R::P6ERR moveMem (P6R::P6VOID *pDest, P6R::P6SIZE cDest, const P6R::P6VOID *pSource, P6R::P6SIZE nBytes)=0
 Copies nBytes from pSource to pDest.
virtual P6R::P6ERR queryInterface (const P6R::IID &iid, P6R::P6VOID **ppIface)=0
 This method queries the component for a specific interface.
virtual P6R::P6INT32 release ()=0
 This method decrements a components reference count.
virtual P6R::P6ERR reverseString (P6R::P6CHAR *pBuffer, P6R::P6SIZE cStart, P6R::P6SIZE cEnd)=0
 Reverse a string in place given starting and ending offests, allowing any portion, or the entire string to be reversed.
virtual P6R::P6ERR reverseStringW (P6R::P6WCHAR *pBuffer, P6R::P6SIZE cStart, P6R::P6SIZE cEnd)=0
 Reverse a string in place given starting and ending offests, allowing any portion, or the entire string to be reversed.
virtual P6R::P6ERR setMem (P6R::P6VOID *pMemory, P6R::P6INT nValue, P6R::P6SIZE nBytes)=0
 Set the specified number of bytes in pMemory to nValue.
virtual P6R::P6ERR sizetToString (P6R::P6SIZE value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a P6SIZE integer to a string with the specified radix.
virtual P6R::P6ERR sizetToStringW (P6R::P6SIZE value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert a P6SIZE integer to a wide character string with the specified radix.
virtual P6R::P6ERR strchr (const P6R::P6CHAR *pStr, P6R::P6INT16 c, P6R::P6SIZE cchMax, P6R::P6CHAR **ppRetPtr)=0
 Finds the first occurance of the character c in pStr.
virtual P6R::P6ERR strcmp (const P6R::P6CHAR *pStr1, const P6R::P6CHAR *pStr2, P6R::P6SIZE cchMax, P6R::P6INT32 *pRetval)=0
 Lexographically compares two strings case sensitively.
virtual P6R::P6ERR strdup (const P6R::P6CHAR *pString, P6R::P6CHAR **ppCopy)=0
 Alocate new storage for and duplicate the specified string into that storage.
virtual P6R::P6ERR strfree (const P6R::P6CHAR *pString)=0
 Frees a previously allocated strdup'd string.
virtual P6R::P6ERR stricmp (const P6R::P6CHAR *pStr1, const P6R::P6CHAR *pStr2, P6R::P6SIZE cchMax, P6R::P6INT32 *pRetval)=0
 Case insensitively lexographically compares two strings.
virtual P6R::P6ERR stristr (const P6R::P6CHAR *searchIn, const P6R::P6CHAR *searchFor, P6R::P6SIZE cchMax, P6R::P6CHAR **ppRetptr)=0
 Find a sub-string (case-insensative).
virtual P6R::P6ERR strlcat (P6R::P6CHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6CHAR *pszSource, P6R::P6SIZE *pcCopied)=0
 Concatenates characters from one string onto another and always NULL terminates the output.
virtual P6R::P6ERR strlcpy (P6R::P6CHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6CHAR *pszSource, P6R::P6SIZE *pcCopied)=0
 Copies pszSource to pszDest and always NULL terminates the output.
virtual P6R::P6ERR strlen (const P6R::P6CHAR *pStr, P6R::P6SIZE cchMax, P6R::P6SIZE *pcSize)=0
 Get the length of a NULL terminated string in bytes excluding the zero terminator and not affected by locale.
virtual P6R::P6ERR strlncpy (P6R::P6CHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6CHAR *pszSource, P6R::P6SIZE cSourceLen, P6R::P6SIZE *pcCopied)=0
 Copies cSourceLen characters from pszSource to pszDest and always NULL terminates the output.
virtual P6R::P6ERR strlwr (P6R::P6CHAR *pszStr, P6R::P6SIZE cchMax)=0
 Converts the specified NULL terminated string to lowercase in-place.
virtual P6R::P6ERR strncat (P6R::P6CHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6CHAR *pszSource, P6R::P6SIZE cCount)=0
 Concatentates cCount characters from pszSource onto pszDest and always NULL terminates the output.
virtual P6R::P6ERR strncmp (const P6R::P6CHAR *pStr1, const P6R::P6CHAR *pStr2, P6R::P6SIZE length, P6R::P6INT32 *pRetval)=0
 Lexographically compares at most the first length character of the two specified strings.
virtual P6R::P6ERR strnicmp (const P6R::P6CHAR *pStr1, const P6R::P6CHAR *pStr2, P6R::P6SIZE length, P6R::P6INT32 *pRetval)=0
 Case insensitively lexographically compares at most the first length character of the two specified strings.
virtual P6R::P6ERR strrchr (const P6R::P6CHAR *pStr, P6R::P6INT16 c, P6R::P6SIZE cchMax, P6R::P6CHAR **ppRetPtr)=0
 Finds the last occurance of c in string,.
virtual P6R::P6ERR strsep (const P6R::P6CHAR **ppszSearchIn, const P6R::P6CHAR *pszDelimiters, P6R::P6BCSTR *pbcsToken)=0
 Extracts a the first token from a string, where the tokens are delimited by the characters in pszDelimiters.
virtual P6R::P6ERR strstr (const P6R::P6CHAR *searchIn, const P6R::P6CHAR *searchFor, P6R::P6SIZE cchMax, P6R::P6CHAR **ppRetptr)=0
 Find a sub-string (case-sensative).
virtual P6R::P6ERR strToBool (const P6R::P6CHAR *pBoolStr, P6R::P6BOOL *pBool)=0
 Converts a boolean string representation to a P6R::P6BOOL.
virtual P6R::P6ERR strupr (P6R::P6CHAR *pszStr, P6R::P6SIZE cchMax)=0
 Converts the specified NULL terminated string to uppercase in-place.
virtual P6R::P6ERR trimEnd (P6R::P6CHAR *pszStr, P6R::P6SIZE cchMax)=0
 Trim trailing space, tab, carraige return and newline characters from the specified NULL terminated string.
virtual P6R::P6ERR trimEndW (P6R::P6WCHAR *pszStr, P6R::P6SIZE cchMax)=0
 Trim trailing space, tab, carraige return and newline characters from the specified NULL terminated wide string.
virtual P6R::P6ERR uint16ToString (P6R::P6UINT16 value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert an unsigned 16 bit integer to a P6CHAR string with the specified radix.
virtual P6R::P6ERR uint16ToStringW (P6R::P6UINT16 value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert an unsigned 16 bit integer to a P6WCHAR string with the specified radix.
virtual P6R::P6ERR uint32ToString (P6R::P6UINT32 value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert an unsigned 32 bit integer to a P6CHAR string with the specified radix.
virtual P6R::P6ERR uint32ToStringW (P6R::P6UINT32 value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert an unsigned 32 bit integer to a P6WCHAR string with the specified radix.
virtual P6R::P6ERR uint64ToString (P6R::P6UINT64 value, P6R::P6CHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert an unsigned 64 bit integer to a P6CHAR string with the specified radix.
virtual P6R::P6ERR uint64ToStringW (P6R::P6UINT64 value, P6R::P6WCHAR *pBuffer, P6R::P6SIZE cBuffer, P6R::P6UINT32 radix, P6R::P6SIZE *pcWritten)=0
 Convert an unsigned 64 bit integer to a P6WCHAR string with the specified radix.
virtual P6R::P6ERR utf8nToWcs (P6R::P6WCHAR *pDest, P6R::P6SIZE *dstSize, const P6R::P6CHAR *pSource, P6R::P6SIZE cCount)=0
 Converts a the number of P6CHAR (UTF-8) string to a P6WCHAR string.
virtual P6R::P6ERR utf8ToWcs (P6R::P6WCHAR *pDest, P6R::P6SIZE *dstSize, const P6R::P6CHAR *pSource)=0
 Converts a P6CHAR (UTF-8) string to a P6WCHAR string.
virtual P6R::P6ERR wcsnToUtf8 (P6R::P6CHAR *pDest, P6R::P6SIZE *dstSize, const P6R::P6WCHAR *pSource, P6R::P6SIZE cCount)=0
 Converts the number of P6WCHAR characters specified in cCount to a P6CHAR UTF-8 string.
virtual P6R::P6ERR wcsToUtf8 (P6R::P6CHAR *pDest, P6R::P6SIZE *dstSize, const P6R::P6WCHAR *pSource)=0
 Converts a P6WCHAR string to a P6CHAR UTF-8 string.
virtual P6R::P6ERR wsetMem (P6R::P6WCHAR *pMemory, P6R::P6WCHAR nValue, P6R::P6SIZE nChars)=0
 Set the specified number of wide characters in pMemory to nValue.
virtual P6R::P6ERR wstrchr (const P6R::P6WCHAR *pStr, P6R::P6WCHAR c, P6R::P6SIZE cchMax, P6R::P6WCHAR **ppRetPtr)=0
 Finds the first occurance of c in the wide character string s.
virtual P6R::P6ERR wstrcmp (const P6R::P6WCHAR *s1, const P6R::P6WCHAR *s2, P6R::P6SIZE cchMax, P6R::P6INT32 *pRetval)=0
 Lexigraphically compares two NULL terminated strings.
virtual P6R::P6ERR wstrdup (const P6R::P6WCHAR *pString, P6R::P6WCHAR **ppCopy)=0
 Duplicates the provided NULL terminated wide character string, allocating memory for it and returning the allocated copy.
virtual P6R::P6ERR wstrfree (const P6R::P6WCHAR *pString)=0
 Frees a string previously allocated via a call to wstrdup().
virtual P6R::P6ERR wstricmp (const P6R::P6WCHAR *s1, const P6R::P6WCHAR *s2, P6R::P6SIZE cchMax, P6R::P6INT32 *pRetval)=0
 Lexigraphically compares two NULL terminated strings ignoring case.
virtual P6R::P6ERR wstrlcat (P6R::P6WCHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6WCHAR *pszSource, P6R::P6SIZE *pcCopied)=0
 Appends one string to another and NULL terminates the result.
virtual P6R::P6ERR wstrlcpy (P6R::P6WCHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6WCHAR *pszSource, P6R::P6SIZE *pcCopied)=0
 Copies a wide character string.
virtual P6R::P6ERR wstrlen (const P6R::P6WCHAR *pwszString, P6R::P6SIZE cchMax, P6R::P6SIZE *pcLen)=0
 Calculates the length of a string (excluding the NULL terminator).
virtual P6R::P6ERR wstrlncpy (P6R::P6WCHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6WCHAR *pszSource, P6R::P6SIZE cSourceLen, P6R::P6SIZE *pcCopied)=0
 Copies a specified number of characters from one string to another.
virtual P6R::P6ERR wstrncat (P6R::P6WCHAR *pszDest, P6R::P6SIZE cDest, const P6R::P6WCHAR *pszSource, P6R::P6SIZE cCount)=0
 Appends cCount characters from pszSource to pszDest.
virtual P6R::P6ERR wstrncmp (const P6R::P6WCHAR *s1, const P6R::P6WCHAR *s2, P6R::P6SIZE length, P6R::P6INT32 *pRetval)=0
 Case-sensitively compares length character of s1 and s2.
virtual P6R::P6ERR wstrnicmp (const P6R::P6WCHAR *s1, const P6R::P6WCHAR *s2, P6R::P6SIZE length, P6R::P6INT32 *pRetval)=0
 Case-insensitively compares length character of s1 and s2.
virtual P6R::P6ERR wstrrchr (const P6R::P6WCHAR *pszSearchIn, P6R::P6INT16 c, P6R::P6SIZE cchMax, P6R::P6WCHAR **ppRetPtr)=0
 Finds the last occurance of c in the wide character string pszSearchIn.
virtual P6R::P6ERR wstrstr (const P6R::P6WCHAR *searchIn, const P6R::P6WCHAR *searchFor, P6R::P6SIZE cchMax, P6R::P6WCHAR **ppRetptr)=0
 Find a sub-string (case-sensative).
virtual P6R::P6ERR wstrToBool (const P6R::P6WCHAR *pBoolStr, P6R::P6BOOL *pBool)=0
 Converts a boolean wide string representation to a P6R::P6BOOL.
virtual P6R::P6ERR wstrupr (P6R::P6WCHAR *pszStr, P6R::P6SIZE cchMax)=0
 Converts the specified NULL terminated wide string to uppercase in-place.

Detailed Description

This runtime interface provides a set of safe string routines that should be used in place of the standard C runtime string routines.

Notably missing from these methods are strcpy() and strcat() which have been replaced with strlcpy() and strlcat().

Each method in this interface is limited to the number of characters that it will process (P6SAFE_MAX_CCH) either internally, or through an argument passed by the caller.

Interface type: Running Interface

Definition at line 594 of file p6runtimeif.h.


The documentation for this interface was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Copyright © 2004 - 2010 P6R Inc. - All Rights Reserved.