1 /**********************************************************************
2  * $Id: cpl_string.h,v 1.3 2005/06/03 03:49:59 daniel Exp $
3  *
4  * Name:     cpl_string.h
5  * Project:  CPL - Common Portability Library
6  * Purpose:  String and StringList functions.
7  * Author:   Daniel Morissette, dmorissette@dmsolutions.ca
8  *
9  **********************************************************************
10  * Copyright (c) 1998, Daniel Morissette
11  *
12  * Permission is hereby granted, free of charge, to any person obtaining a
13  * copy of this software and associated documentation files (the "Software"),
14  * to deal in the Software without restriction, including without limitation
15  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16  * and/or sell copies of the Software, and to permit persons to whom the
17  * Software is furnished to do so, subject to the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be included
20  * in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
25  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28  * DEALINGS IN THE SOFTWARE.
29  **********************************************************************
30  *
31  * $Log: cpl_string.h,v $
32  * Revision 1.3  2005/06/03 03:49:59  daniel
33  * Update email address, website url, and copyright dates
34  *
35  * Revision 1.2  1999/10/29 06:10:12  daniel
36  * Updated cpl_string.*
37  *
38  * Revision 1.4  1999/06/26 14:05:19  warmerda
39  * Added CSLFindString().
40  *
41  * Revision 1.3  1999/02/17 01:41:58  warmerda
42  * Added CSLGetField
43  *
44  * Revision 1.2  1998/12/04 21:40:42  danmo
45  * Added more Name=Value manipulation fuctions
46  *
47  * Revision 1.1  1998/12/03 18:26:02  warmerda
48  * New
49  *
50  **********************************************************************/
51 
52 #ifndef _CPL_STRING_H_INCLUDED
53 #define _CPL_STRING_H_INCLUDED
54 
55 #include "cpl_vsi.h"
56 #include "cpl_error.h"
57 #include "cpl_conv.h"
58 
59 /*=====================================================================
60                    Stringlist functions (strlist.c)
61  =====================================================================*/
62 CPL_C_START
63 
64 char    **CSLAddString(char **papszStrList, const char *pszNewString);
65 int     CSLCount(char **papszStrList);
66 const char *CSLGetField( char **, int );
67 void    CSLDestroy(char **papszStrList);
68 char    **CSLDuplicate(char **papszStrList);
69 
70 char    **CSLTokenizeString(const char *pszString );
71 char    **CSLTokenizeStringComplex(const char *pszString,
72                                    const char *pszDelimiter,
73                                    int bHonourStrings, int bAllowEmptyTokens );
74 
75 int     CSLPrint(char **papszStrList, FILE *fpOut);
76 char    **CSLLoad(const char *pszFname);
77 int     CSLSave(char **papszStrList, const char *pszFname);
78 
79 char  **CSLInsertStrings(char **papszStrList, int nInsertAtLineNo,
80                          char **papszNewLines);
81 char  **CSLInsertString(char **papszStrList, int nInsertAtLineNo,
82                         char *pszNewLine);
83 char  **CSLRemoveStrings(char **papszStrList, int nFirstLineToDelete,
84                          int nNumToRemove, char ***ppapszRetStrings);
85 int	CSLFindString( char **, const char * );
86 
87 const char *CPLSPrintf(char *fmt, ...);
88 char  **CSLAppendPrintf(char **papszStrList, char *fmt, ...);
89 
90 const char *CSLFetchNameValue(char **papszStrList, const char *pszName);
91 char  **CSLFetchNameValueMultiple(char **papszStrList, const char *pszName);
92 char  **CSLAddNameValue(char **papszStrList,
93                         const char *pszName, const char *pszValue);
94 char  **CSLSetNameValue(char **papszStrList,
95                         const char *pszName, const char *pszValue);
96 
97 CPL_C_END
98 
99 #endif /* _CPL_STRING_H_INCLUDED */
100