LCHAR API functions


Detailed Description

LCHAR manipulation functions.


Functions

PORTABLE_API
ESR_ReturnCode 
lstrtrim (LCHAR *text)
PORTABLE_API
ESR_ReturnCode 
lstrinsert (const LCHAR *source, LCHAR *target, size_t offset, size_t *len)
PORTABLE_API
ESR_ReturnCode 
lstrreplace (LCHAR *text, const LCHAR source, const LCHAR target)
PORTABLE_API
ESR_ReturnCode 
lstrtoi (const LCHAR *text, int *result, int base)
PORTABLE_API
ESR_ReturnCode 
lstrtoui (const LCHAR *text, unsigned int *result, int base)
PORTABLE_API
ESR_ReturnCode 
lstrtof (const LCHAR *text, float *result)
PORTABLE_API
ESR_ReturnCode 
lstrtob (const LCHAR *text, ESR_BOOL *result)
PORTABLE_API
ESR_ReturnCode 
LCHARGetInt (LCHAR *text, int *value, LCHAR **finalPosition)
PORTABLE_API
ESR_ReturnCode 
lstrupr (LCHAR *string)
PORTABLE_API
ESR_ReturnCode 
lstrlwr (LCHAR *string)
PORTABLE_API
ESR_ReturnCode 
lstrcasecmp (const LCHAR *string1, const LCHAR *string2, int *result)
PORTABLE_API
ESR_ReturnCode 
litostr (int value, LCHAR *string, size_t *len, int radix)
PORTABLE_API
ESR_ReturnCode 
lultostr (unsigned long value, LCHAR *string, size_t *len, int radix)


Function Documentation

PORTABLE_API ESR_ReturnCode LCHARGetInt ( LCHAR text,
int *  value,
LCHAR **  finalPosition 
)

Returns the first token in the string in the form of an integer.

Parameters:
text Text containing integers
value [out] Integer that was read
finalPosition [out] The first character after the token. A NULL value means this argument is ignored.
Returns:
ESR_INVALID_ARGUMENT is text is null or does not represent an integer value

PORTABLE_API ESR_ReturnCode litostr ( int  value,
LCHAR string,
size_t *  len,
int  radix 
)

Converts int to string

Parameters:
value unsigned long to convert
string [out] String to store
len [in/out] in: length of the buffer; out: length of the converted string
radix Base of value; must be in the range 2 - 36
Returns:
ESR_INVALID_ARGUMENT is string is null; ESR_BUFFER_OVERFLOW is string is not big enough to contain result

PORTABLE_API ESR_ReturnCode lstrcasecmp ( const LCHAR string1,
const LCHAR string2,
int *  result 
)

Binary safe case-insensitive string comparison

Parameters:
string1 Text containing integers
string2 Integer that was read
result [out] returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
Returns:
ESR_INVALID_ARGUMENT is string1 or string2 is null

PORTABLE_API ESR_ReturnCode lstrinsert ( const LCHAR source,
LCHAR target,
size_t  offset,
size_t *  len 
)

Inserts text into a string.

Parameters:
source String to insert
target String to insert into
offset Offset in target string
len [in/out] Length of target argument. If the return code is ESR_BUFFER_OVERFLOW, the required length is returned in this variable.
Returns:
ESR_BUFFER_OVERFLOW is target is too small to insert into

PORTABLE_API ESR_ReturnCode lstrlwr ( LCHAR string  ) 

Convert string to lower case

Parameters:
string [in/out] string to be converted
Returns:
ESR_INVALID_ARGUMENT is string is null

PORTABLE_API ESR_ReturnCode lstrreplace ( LCHAR text,
const LCHAR  source,
const LCHAR  target 
)

Changes all instances of one character to another in a string.

Parameters:
text String to process
source Source character
target Target character
Returns:
ESR_SUCCESS

PORTABLE_API ESR_ReturnCode lstrtob ( const LCHAR text,
ESR_BOOL *  result 
)

Converts string to boolean.

Parameters:
text String to parse
result [out] Resulting value
Returns:
ESR_INVALID_ARGUMENT is text is null or does not represent a boolean value

PORTABLE_API ESR_ReturnCode lstrtof ( const LCHAR text,
float *  result 
)

Converts string to float.

Parameters:
text String to parse
result [out] Resulting value
Returns:
ESR_INVALID_ARGUMENT is text is null or does not represent a number

PORTABLE_API ESR_ReturnCode lstrtoi ( const LCHAR text,
int *  result,
int  base 
)

Converts string to integer.

Parameters:
text String to parse
result [out] Resulting value
base Number base to use
Returns:
ESR_INVALID_ARGUMENT is text is null or does not represent a number

PORTABLE_API ESR_ReturnCode lstrtoui ( const LCHAR text,
unsigned int *  result,
int  base 
)

Converts string to unsigned integer.

Parameters:
text String to parse
result [out] Resulting value
base Number base to use
Returns:
ESR_INVALID_ARGUMENT is text is null or does not represent a number

PORTABLE_API ESR_ReturnCode lstrtrim ( LCHAR text  ) 

Trims string, removing any leading, trailing whitespace.

Parameters:
text Text to trim
Returns:
ESR_SUCCESS

PORTABLE_API ESR_ReturnCode lstrupr ( LCHAR string  ) 

Convert string to upper case

Parameters:
string [in/out] string to be converted
Returns:
ESR_INVALID_ARGUMENT is string is null

PORTABLE_API ESR_ReturnCode lultostr ( unsigned long  value,
LCHAR string,
size_t *  len,
int  radix 
)

Converts unsigned long to string

Parameters:
value unsigned long to convert
string [out] String to store
len [in/out] in: length of the buffer; out: length of the converted string
radix Base of value; must be in the range 2 - 36
Returns:
ESR_INVALID_ARGUMENT is string is null; ESR_BUFFER_OVERFLOW is string is not big enough to contain result


Generated on Thu May 1 15:37:26 2008 for SREC by  doxygen 1.5.3