StringMgr.h
.
Int32 StrAToI (const Char* str)
atoi
routine.
Int16 StrCaselessCompare (const Char* s1, const Char* s2)
s1
> s2
.
s1
< s2
.
stricmp
routine. Use it to find strings, or use it with
StrCompare
to sort strings. (See the comments in StrCompare
for a example code.)
TxtCaselessCompare
instead of this function. Both functions can match single-byte characters with their multi-byte equivalents, but TxtCaselessCompare
can also return the length of the matching text.
StrNCaselessCompare
,
TxtCaselessCompare,
StrCompare
,
StrNCompare
,
TxtCompare
Char* StrCat (Char* dst, const Char* src)
strcat
routine.
Char* StrChr (const Char* str, WChar chr)
str
. Returns NULL
if the character is not found.
strchr
routine.
StrChr
displays a non-fatal error message if chr
is greater than 0xFF
.
StrStr
Int16 StrCompare (const Char* s1, const Char* s2)
s1
sorts after s2
alphabetically.
s1
sorts before s2
alphabetically.
strcmp
routine.
s1
and s2
and returns as soon as it finds two unequal characters. For example, if you are comparing the string "celery" with the string "Cauliflower," StrCompare
returns that "celery" should appear before "Cauliflower" because it sorts the letter "c" before "C."
StrCaselessCompare
before using StrCompare
, as in the following code:
Int16 result = StrCaselessCompare(a, b);
if (result == 0)
    result = StrCompare(a, b);
return(result);
TxtCompare
instead of this function. Both functions can match single-byte characters with their multi-byte equivalents, but TxtCompare
can also return the length of the matching text.
StrNCompare
,
TxtCompare
,
StrCaselessCompare
,
StrNCaselessCompare
,
TxtCaselessCompare
Char* StrCopy (Char* dst, const Char* src)
strcpy
routine.
Char* StrDelocalizeNumber (Char* s, Char thousandSeparator, Char decimalSeparator)
  |
|
Pointer to the number as an ASCII string. |
  |
|
Current thousand separator. |
  |
|
Current decimal separator. |
s
.
StrLocalizeNumber
,
LocGetNumberSeparators
Char* StrIToA (Char* s, Int32 i)
StrAToI
,
StrIToH
Char* StrIToH (Char* s, UInt32 i)
s
.
StrIToA
UInt16 StrLen (const Char* src)
strlen
routine.
Char* StrLocalizeNumber (Char* s, Char thousandSeparator, Char decimalSeparator)
  |
|
Number ASCII string to localize. |
  |
|
Localized thousand separator. |
  |
|
Localized decimal separator. |
s
by replacing all occurrences of "," with thousandSeparator
and all occurrences of "." with decimalSeparator
.
StrDelocalizeNumber
Int16 StrNCaselessCompare (const Char* s1, const Char* s2, Int32 n)
  |
|
Pointer to first string. |
  |
|
Pointer to second string. |
  |
|
Length in bytes of the text to compare. |
s1
> s2
.
s1
< s2
.
TxtCaselessCompare
instead of this function. Both functions can match single-byte characters with their multi-byte equivalents, but TxtCaselessCompare
can also return the length of the matching text.
StrNCompare
,
StrCaselessCompare
,
TxtCaselessCompare
,
StrCompare
,
TxtCompare
Char* StrNCat (Char* dst, const Char* src, Int16 n)
  |
|
Pointer to destination string. |
  |
|
Pointer to source string. |
  |
|
Maximum length in bytes for dst , including the terminating null character. |
strncat
function in these ways:
StrNCat
treats the parameter n
as the maximum length in bytes for dst
. That means it will copy at most n
- StrLen(dst)
- 1 bytes from src
. The standard C function always copies n
bytes from src
into dst
. (It copies the entire src
into dst
if the length of src
is less than n
). n
- 1, StrNCat
stops copying bytes from src
and appends the terminating null character to dst
. If the length of the destination string is already greater than or equal to n
- 1 before the copying begins, StrNCat
does not copy any data from src
. src
is less than n
, the entire src
string is copied into dst
and then the remaining space is filled with null characters. StrNCat
does not fill the remaining space with null characters in released ROMs. In debug ROMs, StrNCat
fills the remaining bytes with the value 0xFE
. Int16 StrNCompare (const Char* s1, const Char* s2, UInt32 n)
  |
|
Pointer to first string. |
  |
|
Pointer to second string. |
  |
|
Length in bytes of text to compare. |
s1
> s2
.
s1
< s2
.
TxtCompare
instead of this function. Both functions can match single-byte characters with their multi-byte equivalents, but TxtCompare
can also return the length of the matching text.
StrCompare
,
TxtCompare
,
StrNCaselessCompare
,
StrCaselessCompare
,
TxtCaselessCompare
dst
string at index n-1 if the source string length was n-1 or less.
Char* StrNCopy (Char* dst, const Char* src, Int16 n)
  |
|
Destination string. |
  |
|
Source string. |
  |
|
Maximum number of bytes to copy from src string. |
n
th byte of src
contains the high-order or middle byte of a multi-byte character, StrNCopy
backs up in dst
until the byte after the end of the previous character, and replaces the remaining bytes (up to n
-1) with nulls.
sprintf
call, which writes formatted output to a string.
Int16 StrPrintF (Char* s,
const Char* formatStr, ...)
  |
|
Pointer to a string where the results are written. |
  |
|
Pointer to the format specification string. |
  |
... |
Zero or more arguments to be formatted as specified by formatStr . |
StrVPrintF
to do the formatting. See that function for details on which format specifications are supported.
StrVPrintF
Char* StrStr (const Char* str, const Char* token)
token
in str
or NULL
if not found.
strstr
routine.
NULL
.
StrChr
Char* StrToLower (Char* dst, const Char* src)
vsprintf
call, which writes formatted output to a string.
Int16 StrVPrintF (Char* s, const Char* formatStr, _Palm_va_list argParam)
  |
|
Pointer to a string where the results are written. This string is always terminated by a null terminator. |
  |
|
Pointer to the format specification string. |
  |
|
Pointer to a list of zero or more parameters to be formatted as specified by the formatStr string. |
vsprintf
function, this function is designed to be called by your own function that takes a variable number of arguments and passes them to this function. For details on how to use it, see "Using the StrVPrintF Function" in Palm OS Programmer's Companion, or refer to vsprintf
in a standard C reference book.
%d
, %i
, %u
, %x
, %s
, and %c
are implemented by StrVPrintF
(and related functions). Optional modifiers that are supported include: +
, -
, <space>, *
, <digits>, h
and l
(long). Following is a brief description of how these format specifications work (see a C book for more details).
#include <stdarg.h>
void MyPrintF(Char* s, Char* formatStr, ...)
{
    va_list args;
Char text[0x100];
    va_start(args, formatStr);
StrVPrintF(text, formatStr, args);
va_end(args);
    MyPutS(text);
}
StrPrintF
, Using the StrVPrintF Function
  |   |