GString.h File Reference

#include "LgiInc.h"
#include "LgiDefs.h"

Go to the source code of this file.

Functions

LgiFunc char * strnchr (const char *s, char c, int Len)
 Returns a pointer to the char 'c' if found in the first 'Len' bytes of the string 's'.
LgiFunc char * strnstr (char *a, const char *b, int n)
 Search for a substring in another string.
LgiFunc char * strnistr (char *a, const char *b, int n)
 Search for a case insensitive sub-string in another string.
LgiFunc char * stristr (const char *a, const char *b)
 Case insensitive sub-string search.
LgiFunc char * strsafecpy (char *dst, const char *src, int len)
 Safe string copy.
LgiFunc char * strsafecat (char *dst, const char *src, int len)
 Safe string append.
LgiFunc int htoi (const char *a)
 Converts a hex string into a integer.
LgiFunc int64 htoi64 (char *a)
 Converts a hex string into a 64bit integer.
LgiFunc char * TrimStr (const char *s, const char *Delim=" \r\n\t")
LgiFunc bool ValidStr (const char *s)
 Returns true if the string points to something with one or more non-whitespace characters.
LgiFunc char * NewStr (const char *s, int Len=-1)
 Makes a heap allocated copy of a string.
LgiFunc bool MatchStr (const char *Template, const char *Data)
 Does a wildcard match.
LgiFunc char16StrchrW (const char16 *s, char16 c)
 Find a character in a wide string.
LgiFunc char16StrrchrW (char16 *s, char16 c)
 Find the last instance of a character in a wide string.
LgiFunc char16StrnchrW (char16 *s, char16 c, int Len)
 Find a character in the first 'n' characters of a wide string.
LgiFunc char16StrstrW (char16 *a, const char16 *b)
 Find a sub-string in a wide string (case sensitive).
LgiFunc char16StristrW (char16 *a, const char16 *b)
 Find a sub-string in a wide string (case insensitive).
LgiFunc char16StrnstrW (char16 *a, const char16 *b, int n)
 Find a sub-string in the first 'n' characters of a wide string (case sensitive).
LgiFunc char16StrnistrW (char16 *a, const char16 *b, int n)
 Find a sub-string in the first 'n' characters of a wide string (case insensitive).
LgiFunc int StrcmpW (const char16 *a, const char16 *b)
 Compare wide strings (case sensitive).
LgiFunc int StricmpW (const char16 *a, const char16 *b)
 Compare wide strings (case insensitive).
LgiFunc int StrncmpW (const char16 *a, const char16 *b, int n)
 Compare 'n' characters of 2 wide strings (case sensitive).
LgiFunc int StrnicmpW (const char16 *a, const char16 *b, int n)
 Compare 'n' characters of 2 wide strings (case insensitive).
LgiFunc char16StrcpyW (char16 *a, const char16 *b)
 String copy one wide string to another.
LgiFunc char16StrncpyW (char16 *a, const char16 *b, int n)
 String copy a maximum of 'n' characters of one wide string to another.
LgiFunc int StrlenW (const char16 *a)
 Count the number of char16's in a wide string.
LgiFunc void StrcatW (char16 *a, const char16 *b)
 Append a wide string to another.
LgiFunc int AtoiW (const char16 *a)
 Convert a wide string to an integer.
LgiFunc int HtoiW (const char16 *a)
 Convert a wide hex string to an integer.
LgiFunc int64 HtoiW64 (const char16 *a)
 Convert a wide hex string to an 64bit integer.
LgiFunc char16NewStrW (const char16 *s, int Len=-1)
 Makes a heap allocated copy of a wide string.
LgiFunc char16TrimStrW (const char16 *s, const char16 *Delim=0)
 Trim delimiters from a wide string. Returns a heap allocated string.
LgiFunc bool ValidStrW (const char16 *s)
 Returns true if 's' points to a wide string with at least 1 non-whitespace character.
LgiFunc bool MatchStrW (const char16 *Template, const char16 *Data)
 Does a widecard match between wide strings.


Detailed Description

Author:
Matthew Allen (fret@memecode.com)

Function Documentation

LgiFunc int htoi ( const char *  a  ) 

Converts a hex string into a integer.

Stops scanning when it hits a NULL or a non-hex character. Accepts input characters in the ranges 0-9, a-f and A-F.

Parameters:
a  The string of hex characters

LgiFunc int64 htoi64 ( char *  a  ) 

Converts a hex string into a 64bit integer.

Stops scanning when it hits a NULL or a non-hex character. Accepts input characters in the ranges 0-9, a-f and A-F.

Parameters:
a  The string of hex characters

LgiFunc bool MatchStr ( const char *  Template,
const char *  Data 
)

Does a wildcard match.

Parameters:
Template  The wildcard template
Data  The string to test against.

LgiFunc char* NewStr ( const char *  s,
int  Len = -1 
)

Makes a heap allocated copy of a string.

Parameters:
s  The input string
Len  The maximum number of bytes in the input string to use or -1 for the whole string.

LgiFunc char16* NewStrW ( const char16 s,
int  Len = -1 
)

Makes a heap allocated copy of a wide string.

Parameters:
s  The input string
Len  The maximum number of bytes in the input string to use or -1 for the whole string.

LgiFunc char* stristr ( const char *  a,
const char *  b 
)

Case insensitive sub-string search.

The search is not case sensitive.

Returns:
A pointer to the sub-string or NULL if not found.
Parameters:
a  The string to search
b  The string to find

LgiFunc char* strnchr ( const char *  s,
char  c,
int  Len 
)

Returns a pointer to the char 'c' if found in the first 'Len' bytes of the string 's'.

Parameters:
s  The string to search
c  The character to find
Len  The maximum number of bytes to search

LgiFunc char* strnistr ( char *  a,
const char *  b,
int  n 
)

Search for a case insensitive sub-string in another string.

The search is not case sensitive.

Returns:
A pointer to the sub-string or NULL if not found.
Parameters:
a  The string to search
b  The string to find
n  The maximum number of bytes of 'a' to search.

LgiFunc char* strnstr ( char *  a,
const char *  b,
int  n 
)

Search for a substring in another string.

The search is case sensitive.

Returns:
A pointer to the sub-string or NULL if not found
Parameters:
a  The string to search
b  The string to find
n  The maximum number of bytes in 'a' to seach through

LgiFunc char* strsafecat ( char *  dst,
const char *  src,
int  len 
)

Safe string append.

This function should be used anytime the size of the destination buffer is known when using strcat. It will truncate the resultant string to fit in the output buffer, properly NULL terminating it.

Parameters:
dst  The destination string buffer
src  The string to append to 'dst'
len  The size in bytes of 'dst'

LgiFunc char* strsafecpy ( char *  dst,
const char *  src,
int  len 
)

Safe string copy.

This function should be used anytime the size of the destination buffer is known when using strcpy. It will truncate the resultant string to fit in the output buffer, properly NULL terminating it.

Parameters:
dst  The destination string buffer
src  The string to append to 'dst'
len  The size in bytes of 'dst'

LgiFunc char* TrimStr ( const char *  s,
const char *  Delim = " \r\n\t" 
)

Trims delimiter characters off a string.

Returns:
A dynamically allocated copy of the input without any delimiter characters on the start or end.


Generated on Wed May 11 07:51:56 2011 for Lgi by  doxygen 1.5.6