Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

KString.h File Reference

String management. More...

#include "ktypes.h"

Defines

#define KString_new(len)   _KString_new (len , __K_FILE__, __K_LINE__)
 Returns a string of length given as a parameter plus 1.
#define k_strcpy(src)   k_strcpy_info (src, __K_FILE__, __K_LINE__)
 Copies the string given as parameter in another one.
#define k_strncpy(src, n)   k_strncpy_info(src, n, __K_FILE__, __K_LINE__)
 Copies the first characters of the string given as parameter in another one.
#define k_strconcat(str1, str2)   _k_strconcat (str1, str2, __K_FILE__, __K_LINE__)
 Concatenates two strings.

Functions

KTL_API KString k_strncat (KString str1, KString str2, KInt n)
 Appends the first characters of a string to another one, plus a terminating null-character.
KTL_API KInt k_strncmp (KCString str1, KCString str2, KInt64 n)
 Compares two strings.
KTL_API KInt k_strncmp_case (KCString str1, KCString str2, KInt64 n)
 Compares two strings.
KTL_API KString _KString_new (const KInt64 len, KString file, KInt32 line)
 Returns a string of length given as a parameter plus 1.
KTL_API KInt64 k_strlen (KCString str)
 Returns the length of a string.
KTL_API KInt k_strcmp (KCString str1, KCString str2)
 Compares two strings.
KTL_API KString k_strcpy_std (KString dst, KCString src)
 Copies the second string into the first one, including the terminating null character.
KTL_API KString k_strncpy_std (KString dst, KCString src, KInt64 bytes)
 Copies the first characters of a string in another one.
KTL_API KString k_strcpy_info (KCString src, KString file, KInt32 line)
 Copies the string given as parameter in another one.
KTL_API KString k_strncpy_info (KCString src, KInt64 n, KString file, KInt32 line)
 Copies the first characters of the string given as parameter in another one.
KTL_API KString _k_strconcat (KString str1, KString str2, KString sFile, KInt32 iLine)
 Concatenates two strings.
KTL_API KChar k_tolower (KChar c)
 Obtains the lower case of a character.
KTL_API KChar k_toupper (KChar c)
 Obtains the upper case of a character.
KTL_API KString KString_cloneToLower (KCString sText)
 Clones the given string and converts it in lower case.
KTL_API KString KString_toLower (KString sText)
 Sets in lower case the given string.
KTL_API KUInt64 KString_find (KCString sText, KCString sRef)
 Searches a string in another one.
KTL_API void KCStrArray_delete (KCStrArray *pCStrArray)
 Deletes a KCStrArray structure.


Detailed Description

String management.

Version:
KToolLib-1.0
Author:
Fabien Gallot
Date:
04/11/2008
Note:
Copyright © 2008-2010 iKlax Media SAS (www.iklaxmedia.com). All rights reserved.

Define Documentation

#define k_strconcat str1,
str2   )     _k_strconcat (str1, str2, __K_FILE__, __K_LINE__)
 

Concatenates two strings.

The second string then the first one and returns the first one with the appropriate size

Parameters:
str1 the first string to be concatenated
str2 the second string to be concatenated
Returns:
the first string with the second concatenated

#define k_strcpy src   )     k_strcpy_info (src, __K_FILE__, __K_LINE__)
 

Copies the string given as parameter in another one.

Parameters:
src the string to be copied
Returns:
the copied string if successful otherwise knull

#define k_strncpy src,
 )     k_strncpy_info(src, n, __K_FILE__, __K_LINE__)
 

Copies the first characters of the string given as parameter in another one.

Parameters:
src the string to be copied
n the maximum number of characters to be copied from the source string
Returns:
the copied string if successful otherwise knull

#define KString_new len   )     _KString_new (len , __K_FILE__, __K_LINE__)
 

Returns a string of length given as a parameter plus 1.

All the characters of the string are equal to ''

Parameters:
len the length of the string to be created
Returns:
the created string if successful otherwise knull


Function Documentation

KTL_API KString _k_strconcat KString  str1,
KString  str2,
KString  sFile,
KInt32  iLine
 

Concatenates two strings.

The second string then the first one and returns the first one with the appropriate size

Warning:
Please do not used this function but prefer k_strconcat
Parameters:
str1 the first string to be concatenated
str2 the second string to be concatenated
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the first string with the second concatenated

KTL_API KString _KString_new const KInt64  len,
KString  file,
KInt32  line
 

Returns a string of length given as a parameter plus 1.

All the characters of the string are equal to ''

Parameters:
len the length of the string to be created
file the file name where this function is called
line the line number where this function is called
Returns:
the created string if successful otherwise knull

KTL_API KInt k_strcmp KCString  str1,
KCString  str2
 

Compares two strings.

This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminating null-character is reached

Parameters:
str1 the first string to be compared
str2 the second string to be compared
Returns:
an integral value indicating the relationship between the strings. A zero value indicates that both strings are equal. A value greater than zero indicates that the first character that does not match has a greater value in the first string than in the second one. And a value less than zero indicates the opposite

KTL_API KString k_strcpy_info KCString  src,
KString  file,
KInt32  line
 

Copies the string given as parameter in another one.

Warning:
Please do not used this function but prefer k_strcpy
Parameters:
src the string to be copied
file the file name where this function is called
line the line number where this function is called
Returns:
the copied string if successful otherwise knull

KTL_API KString k_strcpy_std KString  dst,
KCString  src
 

Copies the second string into the first one, including the terminating null character.

Parameters:
dst the destination string where the content is to be copied
src the string to be copied *
Returns:
the destination string

KTL_API KInt64 k_strlen KCString  str  ) 
 

Returns the length of a string.

The length of a string is determined by the terminating null-character. Thus, the string is as long as the amount of characters between the beginning of the string and the terminating null character

Parameters:
str the string
Returns:
the length of string

KTL_API KString k_strncat KString  str1,
KString  str2,
KInt  n
 

Appends the first characters of a string to another one, plus a terminating null-character.

Parameters:
str1 the string that must be large enough to contain the concatenated resulting string, including the additional null-character
str2 the string to be appended
n the maximum number of characters to be appended
Returns:
the concatenated string

KTL_API KInt k_strncmp KCString  str1,
KCString  str2,
KInt64  n
 

Compares two strings.

Compares up to a maximum number the characters of two strings. This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ, until a terminating null-character is reached, or until a maximum number of characters match in both strings, whichever happens first

Parameters:
str1 the first string to be compared
str2 the second string to be compared
n the maximum number of characters to compare
Returns:
an integral value indicating the relationship between the strings. A zero value indicates that the characters compared in both strings are all equal. A value greater than zero indicates that the first character that does not match has a greater value in the first string than in the second one. And a value less than zero indicates the opposite

KTL_API KInt k_strncmp_case KCString  str1,
KCString  str2,
KInt64  n
 

Compares two strings.

Compares up to a maximum number the characters of two strings by considering the case. This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ, until a terminating null-character is reached, or until a maximum number of characters match in both strings, whichever happens first.

Parameters:
str1 the first string to be compared
str2 the second string to be compared
n the maximum number of characters to compare
Returns:
an integral value indicating the relationship between the strings. A zero value indicates that the characters compared in both strings are all equal. A value greater than zero indicates that the first character that does not match has a greater value in the first string than in the second one. And a value less than zero indicates the opposite

KTL_API KString k_strncpy_info KCString  src,
KInt64  n,
KString  file,
KInt32  line
 

Copies the first characters of the string given as parameter in another one.

Warning:
Please do not used this function but prefer k_strncpy
Parameters:
src the string to be copied
n the maximum number of characters to be copied from the source string
file the file name where this function is called
line the line number where this function is called
Returns:
the copied string if successful otherwise knull

KTL_API KString k_strncpy_std KString  dst,
KCString  src,
KInt64  bytes
 

Copies the first characters of a string in another one.

Parameters:
dst the destination string where the content is to be copied
src the string to be copied
bytes the maximum number of characters to be copied from the source string
Returns:
the destination string

KTL_API KChar k_tolower KChar  c  ) 
 

Obtains the lower case of a character.

Parameters:
c the character to be converted
Returns:
the lower case of the given character

KTL_API KChar k_toupper KChar  c  ) 
 

Obtains the upper case of a character.

Parameters:
c the character to be converted
Returns:
the upper case of the given character

KTL_API void KCStrArray_delete KCStrArray pCStrArray  ) 
 

Deletes a KCStrArray structure.

Parameters:
pCStrArray the pointer to the KCStrArray structure to be deleted

KTL_API KString KString_cloneToLower KCString  sText  ) 
 

Clones the given string and converts it in lower case.

Parameters:
sText the string to be cloned and to be converted
Returns:
the lower case string cloned

KTL_API KUInt64 KString_find KCString  sText,
KCString  sRef
 

Searches a string in another one.

Parameters:
sText the string to be searched
sRef the string where the search is computed
Returns:
the beginning position of the found string if successful otherwise K_MAX_UI64

KTL_API KString KString_toLower KString  sText  ) 
 

Sets in lower case the given string.

Parameters:
sText the string to be converted
Returns:
the lower case string


Generated on Tue Mar 9 10:49:30 2010 for iKlax Tools Library (KToolLib) by doxygen 1.3.8