GDAL

ogr_xerces.h
1 /******************************************************************************
2 * Project: OGR
3 * Purpose: Convenience functions for parsing with Xerces-C library
4 * Author: Even Rouault, <even.rouault at spatialys.com>
5 *
6 ******************************************************************************
7 * Copyright (c) 2016, Even Rouault <even.rouault at spatialys.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
26 ****************************************************************************/
27
28 #ifndef OGR_XERCES_INCLUDED
29 #define OGR_XERCES_INCLUDED
30
31 // Must be first for DEBUG_BOOL case
32 #ifdef HAVE_XERCES
33 #include "ogr_xerces_headers.h"
34 #endif
35
36 #include "cpl_port.h"
37 #include "cpl_string.h"
38 #include "cpl_vsi.h"
39
40 #ifdef HAVE_XERCES
41
42 /* All those functions are for in-tree drivers use only ! */
43
44 /* Thread-safe initialization/de-initialization. Calls should be paired */
45 bool CPL_DLL OGRInitializeXerces(void);
46 void CPL_DLL OGRDeinitializeXerces(void);
47
48 InputSource CPL_DLL* OGRCreateXercesInputSource(VSILFILE* fp);
49 void CPL_DLL OGRDestroyXercesInputSource(InputSource* is);
50
51 void CPL_DLL OGRStartXercesLimitsForThisThread(size_t nMaxMemAlloc,
52 const char* pszMsgMaxMemAlloc,
53 double dfTimeoutSecond,
54 const char* pszMsgTimeout);
55 void CPL_DLL OGRStopXercesLimitsForThisThread();
56
57 namespace OGR
58 {
59 CPLString CPL_DLL transcode( const XMLCh *panXMLString, int nLimitingChars = -1 );
60 CPLString CPL_DLL &transcode( const XMLCh *panXMLString, CPLString& osRet,
61 int nLimitingChars = -1 );
62 }
63
64 #ifndef OGR_USING
65 using OGR::transcode;
66 #endif
67
68 void OGRCleanupXercesMutex(void);
69
70 #endif /* HAVE_XERCES */
71
72 #endif /* OGR_XERCES_INCLUDED */
cpl_vsi.h
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:332
cpl_string.h
cpl_port.h
VSILFILE
FILE VSILFILE
Opaque type for a FILE that implements the VSIVirtualHandle API.
Definition: cpl_vsi.h:156