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

KStrList.h File Reference

Linked list that contains strings. More...

#include "ktypes.h"

Data Structures

struct  _KStrList
 List of string structure. More...

Defines

#define KStrList_new()   _KStrList_new(__K_FILE__, __K_LINE__)
 Creates an empty string list.
#define KStrList_create(sData, pNext)   _KStrList_create(sData, pNext, __K_FILE__, __K_LINE__)
 Creates a link and initializes it.
#define KStrList_delete(pSList)   _KStrList_delete (pSList, __K_FILE__, __K_LINE__)
 Deletes a list and all its strings.
#define KStrList_deleteElements(ppSList)   _KStrList_deleteElements (ppSList, __K_FILE__, __K_LINE__)
 Removes all the strings of a list.
#define KStrList_clone(pList)   _KStrList_clone(pList, __K_FILE__, __K_LINE__)
 Clones a list of strings.
#define KStrList_append(pSList, sData)   _KStrList_append(pSList, sData, __K_FILE__, __K_LINE__)
 Adds a string at the end of the list.
#define KStrList_insert(pSList, iIdx, sData)   _KStrList_insert (pSList, iIdx, sData, __K_FILE__, __K_LINE__)
 Inserts a string at a given position in a list.
#define KStrList_marshalling(pList, pSize)   _KStrList_marshalling (pList, pSize, __K_FILE__, __K_LINE__)
 Serializes a list of strings.
#define KStrList_unmarshalling(pList)   _KStrList_unmarshalling (pList, __K_FILE__, __K_LINE__)
 Deserializes a list of strings.

Typedefs

typedef _KStrList KStrList
 List of string structure.

Functions

KTL_API KStrList_KStrList_new (KString sFile, KInt32 iLine)
 Creates an empty string list.
KTL_API KBool KStrList_init (KStrList *pSList, KCString sData, KStrList *pNext)
 Initializes a link of the list.
KTL_API KStrList_KStrList_create (KCString sData, KStrList *pNext, KString sFile, KInt32 iLine)
 Creates a link and initializes it.
KTL_API void _KStrList_delete (KStrList **pSList, KString sFile, KInt32 iLine)
 Deletes a list and all its strings.
KTL_API void _KStrList_deleteElements (KStrList **pSList, KString sFile, KInt32 iLine)
 Removes all the strings of a list.
KTL_API KStrList_KStrList_clone (KStrList *pList, KString sFile, KInt32 iLine)
 Clones a list of strings.
KTL_API KStrList_KStrList_append (KStrList *pSList, KCString sData, KString sFile, KInt32 iLine)
 Adds a string at the end of the list.
KTL_API KStrListKStrList_remove_link (KStrList *pSList, KStrList *pLink)
 Removes a link of the list.
KTL_API KStrListKStrList_remove_data (KStrList *pSList, KCString sData)
 Removes a string from the list.
KTL_API KBool KStrList_contains (KStrList *pSList, KCString sData)
 Searches of a string in a list.
KTL_API KInt32 KStrList_index_of (KStrList *pSList, KCString sData)
 Obtains the index of the first string from a list.
KTL_API KStrList_KStrList_insert (KStrList *pSList, KInt iIdx, KCString sData, KString sFile, KInt32 iLine)
 Inserts a string at a given position in a list.
KTL_API KUInt32 KStrList_size (KStrList *pSList)
 Gets the number of string of a list.
KTL_API KStrListKStrList_concat (KStrList *pL1, KStrList *pL2)
 Concatenates two lists.
KTL_API void KStrList_print_str (KStrList *pList)
 Writes to the standard output all the strings of a list.
KTL_API KStrListKStrList_insert_order (KStrList *pList, KCString sValue, KFunc_cmp *fCmpFunc)
 Inserts a string to a list in ascending order regarding the comparison function.
KTL_API KStrListKStrList_remove_at (KStrList *pList, KInt iN)
 Removes at a given position a string from a list.
KTL_API KCString KStrList_data_at (KStrList *pList, KInt n)
 Returned an element at a given position in a list.
KTL_API KUChar_KStrList_marshalling (KStrList *pList, KUInt64 *pSize, KString sFile, KInt32 iLine)
 Serializes a list of strings.
KTL_API KStrList_KStrList_unmarshalling (const KUChar *pList, KString sFile, KInt32 iLine)
 Deserializes a list of strings.
KTL_API KUCharKStrList_convertInt2UChar (KUInt32 iInt)
 Converts an integral number to an unsigned characters array (four bytes).
KTL_API KUInt32 KStrList_convertUChar2Int (KUChar *pUChar)
 Converts an unsigned characters array (four bytes) to an integral number.


Detailed Description

Linked list that contains strings.

Version:
KToolLib-1.0
Author:
Emmanuel Bouix
Date:
10/08/2009
Note:
Copyright © 2008-2010 iKlax Media SAS (www.iklaxmedia.com). All rights reserved.

Define Documentation

#define KStrList_append pSList,
sData   )     _KStrList_append(pSList, sData, __K_FILE__, __K_LINE__)
 

Adds a string at the end of the list.

Parameters:
pSList the pointer to the list where string should be added
sData the string to be added
Returns:
the pointer to the list with the string added if successful otherwise knull

#define KStrList_clone pList   )     _KStrList_clone(pList, __K_FILE__, __K_LINE__)
 

Clones a list of strings.

Parameters:
pList the pointer to the list to be cloned
Returns:
the cloned list if successful otherwise knull

#define KStrList_create sData,
pNext   )     _KStrList_create(sData, pNext, __K_FILE__, __K_LINE__)
 

Creates a link and initializes it.

Parameters:
sData the string of the link
pNext the pointer to the next link of the list
Returns:
the created list if successful otherwise knull

#define KStrList_delete pSList   )     _KStrList_delete (pSList, __K_FILE__, __K_LINE__)
 

Deletes a list and all its strings.

Parameters:
pSList the pointers to the list to be deleted

#define KStrList_deleteElements ppSList   )     _KStrList_deleteElements (ppSList, __K_FILE__, __K_LINE__)
 

Removes all the strings of a list.

Parameters:
ppSList the pointers to the list

#define KStrList_insert pSList,
iIdx,
sData   )     _KStrList_insert (pSList, iIdx, sData, __K_FILE__, __K_LINE__)
 

Inserts a string at a given position in a list.

Parameters:
pSList the pointer to the list where string should be inserted
iIdx the position of the inserted string
sData the string to be inserted
Returns:
the pointer to the list where string is inserted if successful otherwise knull

#define KStrList_marshalling pList,
pSize   )     _KStrList_marshalling (pList, pSize, __K_FILE__, __K_LINE__)
 

Serializes a list of strings.

Parameters:
pList the pointer to the list to be serialized
pSize the pointer to the size of the list to be serialized
Returns:
the pointer to the serialized list if successful otherwise knull

 
#define KStrList_new  )     _KStrList_new(__K_FILE__, __K_LINE__)
 

Creates an empty string list.

Returns:
the created list if successful otherwise knull

#define KStrList_unmarshalling pList   )     _KStrList_unmarshalling (pList, __K_FILE__, __K_LINE__)
 

Deserializes a list of strings.

Parameters:
pList the pointer to a serialized list
Returns:
the pointer to a list of strings deserialized if successful otherwise knull


Function Documentation

KTL_API KStrList* _KStrList_append KStrList pSList,
KCString  sData,
KString  sFile,
KInt32  iLine
 

Adds a string at the end of the list.

Parameters:
pSList the pointer to the list where string should be added
sData the string to be added
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the pointer to the list with the string added if successful otherwise knull

KTL_API KStrList* _KStrList_clone KStrList pList,
KString  sFile,
KInt32  iLine
 

Clones a list of strings.

Parameters:
pList the pointer to the list to be cloned
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the cloned list if successful otherwise knull

KTL_API KStrList* _KStrList_create KCString  sData,
KStrList pNext,
KString  sFile,
KInt32  iLine
 

Creates a link and initializes it.

Parameters:
sData the string of the link
pNext the pointer to the next link of the list
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the created list if successful otherwise knull

KTL_API void _KStrList_delete KStrList **  pSList,
KString  sFile,
KInt32  iLine
 

Deletes a list and all its strings.

Parameters:
pSList the pointers to the list to be deleted
sFile the file name where this function is called
iLine the line number where this function is called

KTL_API void _KStrList_deleteElements KStrList **  pSList,
KString  sFile,
KInt32  iLine
 

Removes all the strings of a list.

Parameters:
pSList the pointers to the list
sFile the file name where this function is called
iLine the line number where this function is called

KTL_API KStrList* _KStrList_insert KStrList pSList,
KInt  iIdx,
KCString  sData,
KString  sFile,
KInt32  iLine
 

Inserts a string at a given position in a list.

Parameters:
pSList the pointer to the list where string should be inserted
iIdx the position of the inserted string
sData the string to be inserted
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the pointer to the list where string is inserted if successful otherwise knull

KTL_API KUChar* _KStrList_marshalling KStrList pList,
KUInt64 pSize,
KString  sFile,
KInt32  iLine
 

Serializes a list of strings.

Parameters:
pList the pointer to the list to be serialized
pSize the pointer to the size of the list to be serialized
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the pointer to the serialized list if successful otherwise knull

KTL_API KStrList* _KStrList_new KString  sFile,
KInt32  iLine
 

Creates an empty string list.

Parameters:
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the created list if successful otherwise knull

KTL_API KStrList* _KStrList_unmarshalling const KUChar pList,
KString  sFile,
KInt32  iLine
 

Deserializes a list of strings.

Parameters:
pList the pointer to a serialized list
sFile the file name where this function is called
iLine the line number where this function is called
Returns:
the pointer to a list of strings deserialized if successful otherwise knull

KTL_API KStrList* KStrList_concat KStrList pL1,
KStrList pL2
 

Concatenates two lists.

Parameters:
pL1 the pointer to the first list
pL2 the pointer to the second list
Returns:
the pointer to the concatenated list

KTL_API KBool KStrList_contains KStrList pSList,
KCString  sData
 

Searches of a string in a list.

Parameters:
pSList the pointer to the list where string should be searched
sData the string to be searched
Returns:
ktrue if the string is found otherwise kfalse

KTL_API KUChar* KStrList_convertInt2UChar KUInt32  iInt  ) 
 

Converts an integral number to an unsigned characters array (four bytes).

Parameters:
iInt the integral number to be converted
Returns:
the pointer to the unsigned characters array

KTL_API KUInt32 KStrList_convertUChar2Int KUChar pUChar  ) 
 

Converts an unsigned characters array (four bytes) to an integral number.

Parameters:
pUChar the pointer to the unsigned characters array to be converted
Returns:
the integral number

KTL_API KCString KStrList_data_at KStrList pList,
KInt  n
 

Returned an element at a given position in a list.

Parameters:
pList the pointer to the list
n the position of the element to be returned
Returns:
the pointer to the returned element if successful otherwise knull

KTL_API KInt32 KStrList_index_of KStrList pSList,
KCString  sData
 

Obtains the index of the first string from a list.

Parameters:
pSList the pointer to the list where string should be searched
sData the string to be searched
Returns:
the index of the string if successful otherwise -1

KTL_API KBool KStrList_init KStrList pSList,
KCString  sData,
KStrList pNext
 

Initializes a link of the list.

Parameters:
pSList the pointer to the list to be initialized
sData the string of the first link
pNext the pointer to the next link of the list
Returns:
ktrue if successful otherwise kfalse

KTL_API KStrList* KStrList_insert_order KStrList pList,
KCString  sValue,
KFunc_cmp fCmpFunc
 

Inserts a string to a list in ascending order regarding the comparison function.

Parameters:
pList the pointer to the list where string should be inserted
sValue the value used by the comparison function
fCmpFunc the pointer to the comparison function
Returns:
the pointer to the list where the string is inserted if successful otherwise knull

KTL_API void KStrList_print_str KStrList pList  ) 
 

Writes to the standard output all the strings of a list.

Parameters:
pList the pointer to the list to be displayed

KTL_API KStrList* KStrList_remove_at KStrList pList,
KInt  iN
 

Removes at a given position a string from a list.

Parameters:
pList the pointer to the list where string should be removed
iN the position of the string to be removed
Returns:
the pointer to the list where the string is removed if successful otherwise knull

KTL_API KStrList* KStrList_remove_data KStrList pSList,
KCString  sData
 

Removes a string from the list.

Parameters:
pSList the pointer to the list where string should be removed
sData the string to be removed
Returns:
the pointer to the list where string is removed if successful otherwise knull

KTL_API KStrList* KStrList_remove_link KStrList pSList,
KStrList pLink
 

Removes a link of the list.

Parameters:
pSList the pointer to the list where link should be removed
pLink the link to be removed
Returns:
the pointer to the list where link is removed if successful otherwise knull

KTL_API KUInt32 KStrList_size KStrList pSList  ) 
 

Gets the number of string of a list.

Parameters:
pSList the pointer to the list
Returns:
the size of the list if successful otherwise 0


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