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#ifdef HAVE_XERCES
32#include "ogr_xerces_headers.h"
33#endif
34
35#include "cpl_port.h"
36#include "cpl_string.h"
37#include "cpl_vsi.h"
38
39#ifdef HAVE_XERCES
40
41/* All those functions are for in-tree drivers use only ! */
42
43/* Thread-safe initialization/de-initialization. Calls should be paired */
44bool CPL_DLL OGRInitializeXerces(void);
45void CPL_DLL OGRDeinitializeXerces(void);
46
47InputSource CPL_DLL *OGRCreateXercesInputSource(VSILFILE *fp);
48void CPL_DLL OGRDestroyXercesInputSource(InputSource *is);
49
50void CPL_DLL OGRStartXercesLimitsForThisThread(size_t nMaxMemAlloc,
51 const char *pszMsgMaxMemAlloc,
52 double dfTimeoutSecond,
53 const char *pszMsgTimeout);
54void CPL_DLL OGRStopXercesLimitsForThisThread();
55
56namespace OGR
57{
58CPLString CPL_DLL transcode(const XMLCh *panXMLString, int nLimitingChars = -1);
59CPLString CPL_DLL &transcode(const XMLCh *panXMLString, CPLString &osRet,
60 int nLimitingChars = -1);
61} // namespace OGR
62
63#ifndef OGR_USING
64using OGR::transcode;
65#endif
66
67void OGRCleanupXercesMutex(void);
68
69#endif /* HAVE_XERCES */
70
71#endif /* OGR_XERCES_INCLUDED */
Convenient string class based on std::string.
Definition cpl_string.h:320
Core portability definitions for CPL.
Various convenience functions for working with strings and string lists.
Standard C Covers.
Virtual file handle.
Definition cpl_vsi_virtual.h:63