gwenhywfar 5.12.0
stringlist2.h File Reference
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/stringlist.h>
#include <gwenhywfar/types.h>
#include <gwenhywfar/refptr.h>
#include <gwenhywfar/list.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/xml.h>
Include dependency graph for stringlist2.h:

Go to the source code of this file.

Typedefs

typedef struct GWEN_STRINGLIST2 GWEN_STRINGLIST2
typedef GWEN_LIST_ITERATOR GWEN_STRINGLIST2_ITERATOR

Enumerations

enum  GWEN_STRINGLIST2_INSERTMODE { GWEN_StringList2_IntertMode_AlwaysAdd =0 , GWEN_StringList2_IntertMode_NoDouble , GWEN_StringList2_IntertMode_Reuse }

Functions

GWENHYWFAR_API int GWEN_StringList2_AppendString (GWEN_STRINGLIST2 *sl2, const char *s, int take, GWEN_STRINGLIST2_INSERTMODE m)
GWENHYWFAR_API void GWEN_StringList2_Dump (const GWEN_STRINGLIST2 *sl2)
GWENHYWFAR_API GWEN_STRINGLIST2GWEN_StringList2_dup (GWEN_STRINGLIST2 *sl2)
GWENHYWFAR_API GWEN_STRINGLIST2_ITERATORGWEN_StringList2_First (const GWEN_STRINGLIST2 *l)
GWENHYWFAR_API void GWEN_StringList2_free (GWEN_STRINGLIST2 *sl2)
GWENHYWFAR_API GWEN_STRINGLIST2GWEN_StringList2_fromDb (GWEN_DB_NODE *db, const char *name, GWEN_STRINGLIST2_INSERTMODE m)
GWENHYWFAR_API GWEN_STRINGLIST2GWEN_StringList2_fromXml (GWEN_XMLNODE *node, GWEN_STRINGLIST2_INSERTMODE m)
GWENHYWFAR_API unsigned int GWEN_StringList2_GetCount (const GWEN_STRINGLIST2 *l)
GWENHYWFAR_API const char * GWEN_StringList2_GetStringAt (const GWEN_STRINGLIST2 *sl2, int idx)
GWENHYWFAR_API int GWEN_StringList2_HasString (const GWEN_STRINGLIST2 *sl2, const char *s)
GWENHYWFAR_API int GWEN_StringList2_InsertString (GWEN_STRINGLIST2 *sl2, const char *s, int take, GWEN_STRINGLIST2_INSERTMODE m)
GWENHYWFAR_API GWEN_STRINGLIST2_ITERATORGWEN_StringList2_Last (const GWEN_STRINGLIST2 *l)
GWENHYWFAR_API GWEN_STRINGLIST2GWEN_StringList2_new (void)
GWENHYWFAR_API int GWEN_StringList2_RemoveString (GWEN_STRINGLIST2 *sl2, const char *s)
GWENHYWFAR_API void GWEN_StringList2_SetIgnoreRefCount (GWEN_STRINGLIST2 *sl2, int i)
GWENHYWFAR_API void GWEN_StringList2_SetSenseCase (GWEN_STRINGLIST2 *sl2, int i)
GWENHYWFAR_API int GWEN_StringList2_toDb (GWEN_STRINGLIST2 *sl2, GWEN_DB_NODE *db, const char *varName)
GWENHYWFAR_API int GWEN_StringList2_toXml (GWEN_STRINGLIST2 *sl2, GWEN_XMLNODE *node)
GWENHYWFAR_API const char * GWEN_StringList2Iterator_Data (GWEN_STRINGLIST2_ITERATOR *li)
GWENHYWFAR_API GWEN_REFPTRGWEN_StringList2Iterator_DataRefPtr (GWEN_STRINGLIST2_ITERATOR *li)
GWENHYWFAR_API void GWEN_StringList2Iterator_free (GWEN_STRINGLIST2_ITERATOR *li)
GWENHYWFAR_API unsigned int GWEN_StringList2Iterator_GetLinkCount (const GWEN_STRINGLIST2_ITERATOR *li)
GWENHYWFAR_API const char * GWEN_StringList2Iterator_Next (GWEN_STRINGLIST2_ITERATOR *li)
GWENHYWFAR_API const char * GWEN_StringList2Iterator_Previous (GWEN_STRINGLIST2_ITERATOR *li)

Typedef Documentation

◆ GWEN_STRINGLIST2

Definition at line 43 of file stringlist2.h.

◆ GWEN_STRINGLIST2_ITERATOR

Definition at line 44 of file stringlist2.h.

Enumeration Type Documentation

◆ GWEN_STRINGLIST2_INSERTMODE

Enumerator
GWEN_StringList2_IntertMode_AlwaysAdd 
GWEN_StringList2_IntertMode_NoDouble 
GWEN_StringList2_IntertMode_Reuse 

Definition at line 47 of file stringlist2.h.

Function Documentation

◆ GWEN_StringList2_AppendString()

GWENHYWFAR_API int GWEN_StringList2_AppendString ( GWEN_STRINGLIST2 * sl2,
const char * s,
int take,
GWEN_STRINGLIST2_INSERTMODE m )

Appends a string.

Returns
0 if not appended, !=0 if appended
Parameters
takeif true then the StringList takes over ownership of the string
checkDoubleif true the the string will only be appended if it does not already exist

Definition at line 196 of file stringlist2.c.

References GWEN_List_GetRefPtrInfo(), GWEN_List_PushBackRefPtr(), GWEN_ListIterator_IncLinkCount(), GWEN_RefPtr_AddFlags(), GWEN_REFPTR_FLAGS_AUTODELETE, GWEN_RefPtr_new(), GWEN_StringList2__GetString(), GWEN_StringList2_IntertMode_AlwaysAdd, GWEN_StringList2_IntertMode_NoDouble, GWEN_StringList2_IntertMode_Reuse, and GWEN_StringList2Iterator_free().

Referenced by GWEN_StringList2_fromDb(), GWEN_StringList2_fromXml(), and GWEN_XML_AddNameSpace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2_Dump()

GWENHYWFAR_API void GWEN_StringList2_Dump ( const GWEN_STRINGLIST2 * sl2)

◆ GWEN_StringList2_dup()

GWENHYWFAR_API GWEN_STRINGLIST2 * GWEN_StringList2_dup ( GWEN_STRINGLIST2 * sl2)

Definition at line 73 of file stringlist2.c.

References GWEN_List_dup(), and GWEN_NEW_OBJECT.

Referenced by GWEN_Param_copy(), and GWEN_Param_dup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2_First()

◆ GWEN_StringList2_free()

GWENHYWFAR_API void GWEN_StringList2_free ( GWEN_STRINGLIST2 * sl2)

Definition at line 63 of file stringlist2.c.

References GWEN_FREE_OBJECT, and GWEN_List_free().

Referenced by GWEN_Param_copy(), GWEN_Param_dup(), GWEN_Param_free(), GWEN_Param_ReadDb(), GWEN_Param_ReadXml(), GWEN_Param_SetChoices(), and GWEN_XMLNode_NormalizeNameSpaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2_fromDb()

GWENHYWFAR_API GWEN_STRINGLIST2 * GWEN_StringList2_fromDb ( GWEN_DB_NODE * db,
const char * name,
GWEN_STRINGLIST2_INSERTMODE m )

Definition at line 118 of file stringlist2.c.

References GWEN_DB_GetCharValue(), GWEN_StringList2_AppendString(), GWEN_StringList2_new(), and NULL.

Referenced by GWEN_Param_ReadDb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2_fromXml()

GWENHYWFAR_API GWEN_STRINGLIST2 * GWEN_StringList2_fromXml ( GWEN_XMLNODE * node,
GWEN_STRINGLIST2_INSERTMODE m )

Definition at line 159 of file stringlist2.c.

References GWEN_StringList2_AppendString(), GWEN_StringList2_new(), GWEN_XMLNode_GetData(), GWEN_XMLNode_GetFirstData(), GWEN_XMLNode_GetFirstTag(), and GWEN_XMLNode_GetNextTag().

Referenced by GWEN_Param_ReadXml().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2_GetCount()

GWENHYWFAR_API unsigned int GWEN_StringList2_GetCount ( const GWEN_STRINGLIST2 * l)

Definition at line 480 of file stringlist2.c.

References GWEN_List_GetSize().

Here is the call graph for this function:

◆ GWEN_StringList2_GetStringAt()

GWENHYWFAR_API const char * GWEN_StringList2_GetStringAt ( const GWEN_STRINGLIST2 * sl2,
int idx )

◆ GWEN_StringList2_HasString()

GWENHYWFAR_API int GWEN_StringList2_HasString ( const GWEN_STRINGLIST2 * sl2,
const char * s )

Checks whether the given string already exists within in the string list.

Returns
!=0 if found, 0 otherwise

Definition at line 303 of file stringlist2.c.

References GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().

Here is the call graph for this function:

◆ GWEN_StringList2_InsertString()

GWENHYWFAR_API int GWEN_StringList2_InsertString ( GWEN_STRINGLIST2 * sl2,
const char * s,
int take,
GWEN_STRINGLIST2_INSERTMODE m )

Inserts a string.

Returns
0 if not inserted, !=0 if inserted
Parameters
takeif true then the StringList takes over ownership of the string
checkDoubleif true the the string will only be appended if it does not already exist

Definition at line 239 of file stringlist2.c.

References GWEN_List_GetRefPtrInfo(), GWEN_List_PushFrontRefPtr(), GWEN_ListIterator_IncLinkCount(), GWEN_RefPtr_AddFlags(), GWEN_REFPTR_FLAGS_AUTODELETE, GWEN_RefPtr_new(), GWEN_StringList2__GetString(), GWEN_StringList2_IntertMode_AlwaysAdd, GWEN_StringList2_IntertMode_NoDouble, GWEN_StringList2_IntertMode_Reuse, and GWEN_StringList2Iterator_free().

Here is the call graph for this function:

◆ GWEN_StringList2_Last()

GWENHYWFAR_API GWEN_STRINGLIST2_ITERATOR * GWEN_StringList2_Last ( const GWEN_STRINGLIST2 * l)

Definition at line 427 of file stringlist2.c.

References GWEN_List_Last().

Here is the call graph for this function:

◆ GWEN_StringList2_new()

GWENHYWFAR_API GWEN_STRINGLIST2 * GWEN_StringList2_new ( void )

Definition at line 45 of file stringlist2.c.

References GWEN_List_new(), GWEN_List_SetRefPtrInfo(), GWEN_NEW_OBJECT, GWEN_RefPtrInfo_free(), GWEN_RefPtrInfo_new(), and GWEN_RefPtrInfo_SetFreeFn().

Referenced by GWEN_StringList2_fromDb(), GWEN_StringList2_fromXml(), and GWEN_XMLNode_NormalizeNameSpaces().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2_RemoveString()

GWENHYWFAR_API int GWEN_StringList2_RemoveString ( GWEN_STRINGLIST2 * sl2,
const char * s )

Removes a given string from the stringlist.

Returns
0 if not found, !=0 if found and removed

Definition at line 282 of file stringlist2.c.

References GWEN_List_Erase(), GWEN_ListIterator_GetLinkCount(), GWEN_StringList2__GetString(), and GWEN_StringList2Iterator_free().

Here is the call graph for this function:

◆ GWEN_StringList2_SetIgnoreRefCount()

GWENHYWFAR_API void GWEN_StringList2_SetIgnoreRefCount ( GWEN_STRINGLIST2 * sl2,
int i )

Normally this group of functions ignores reference counters on stringlist entries when removing a string via GWEN_StringList2_RemoveString. You can change this behaviour here.

Parameters
sl2string list
iif 0 then reference counters are honoured

References GWENHYWFAR_API.

◆ GWEN_StringList2_SetSenseCase()

GWENHYWFAR_API void GWEN_StringList2_SetSenseCase ( GWEN_STRINGLIST2 * sl2,
int i )

Normally this group of functions ignores cases when comparing two strings. You can change this behaviour here.

Parameters
sl2string list
iif 0 then cases are ignored

Definition at line 188 of file stringlist2.c.

◆ GWEN_StringList2_toDb()

GWENHYWFAR_API int GWEN_StringList2_toDb ( GWEN_STRINGLIST2 * sl2,
GWEN_DB_NODE * db,
const char * varName )

Definition at line 86 of file stringlist2.c.

References DBG_INFO, GWEN_DB_DeleteVar(), GWEN_DB_SetCharValue(), GWEN_LOGDOMAIN, GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), and GWEN_StringList2Iterator_Next().

Referenced by GWEN_Param_WriteDb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2_toXml()

GWENHYWFAR_API int GWEN_StringList2_toXml ( GWEN_STRINGLIST2 * sl2,
GWEN_XMLNODE * node )

Definition at line 138 of file stringlist2.c.

References GWEN_StringList2_First(), GWEN_StringList2Iterator_Data(), GWEN_StringList2Iterator_free(), GWEN_StringList2Iterator_Next(), and GWEN_XMLNode_SetCharValue().

Referenced by GWEN_Param_WriteXml().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2Iterator_Data()

GWENHYWFAR_API const char * GWEN_StringList2Iterator_Data ( GWEN_STRINGLIST2_ITERATOR * li)

Definition at line 456 of file stringlist2.c.

References GWEN_ListIterator_Data().

Referenced by GWEN_StringList2_Dump(), GWEN_StringList2_HasString(), GWEN_StringList2_toDb(), GWEN_StringList2_toXml(), GWEN_XML_FindNameSpace(), GWEN_XML_FindNameSpaceByName(), and GWEN_XML_FindNameSpaceByPrefix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2Iterator_DataRefPtr()

GWENHYWFAR_API GWEN_REFPTR * GWEN_StringList2Iterator_DataRefPtr ( GWEN_STRINGLIST2_ITERATOR * li)

Definition at line 464 of file stringlist2.c.

References GWEN_ListIterator_DataRefPtr().

Here is the call graph for this function:

◆ GWEN_StringList2Iterator_free()

◆ GWEN_StringList2Iterator_GetLinkCount()

GWENHYWFAR_API unsigned int GWEN_StringList2Iterator_GetLinkCount ( const GWEN_STRINGLIST2_ITERATOR * li)

Definition at line 472 of file stringlist2.c.

References GWEN_ListIterator_GetLinkCount().

Referenced by GWEN_StringList2_Dump().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2Iterator_Next()

GWENHYWFAR_API const char * GWEN_StringList2Iterator_Next ( GWEN_STRINGLIST2_ITERATOR * li)

Definition at line 449 of file stringlist2.c.

References GWEN_ListIterator_Next().

Referenced by GWEN_StringList2_Dump(), GWEN_StringList2_HasString(), GWEN_StringList2_toDb(), GWEN_StringList2_toXml(), GWEN_XML_FindNameSpace(), GWEN_XML_FindNameSpaceByName(), and GWEN_XML_FindNameSpaceByPrefix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_StringList2Iterator_Previous()

GWENHYWFAR_API const char * GWEN_StringList2Iterator_Previous ( GWEN_STRINGLIST2_ITERATOR * li)

Definition at line 442 of file stringlist2.c.

References GWEN_ListIterator_Previous().

Here is the call graph for this function: