|
SpatiaLite 4.3.0a
|
00001 /* 00002 gg_xml.h -- Gaia common support for XML documents 00003 00004 version 4.3, 2015 June 29 00005 00006 Author: Sandro Furieri a.furieri@lqt.it 00007 00008 ------------------------------------------------------------------------------ 00009 00010 Version: MPL 1.1/GPL 2.0/LGPL 2.1 00011 00012 The contents of this file are subject to the Mozilla Public License Version 00013 1.1 (the "License"); you may not use this file except in compliance with 00014 the License. You may obtain a copy of the License at 00015 http://www.mozilla.org/MPL/ 00016 00017 Software distributed under the License is distributed on an "AS IS" basis, 00018 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 00019 for the specific language governing rights and limitations under the 00020 License. 00021 00022 The Original Code is the SpatiaLite library 00023 00024 The Initial Developer of the Original Code is Alessandro Furieri 00025 00026 Portions created by the Initial Developer are Copyright (C) 2008-2015 00027 the Initial Developer. All Rights Reserved. 00028 00029 Contributor(s): 00030 00031 Alternatively, the contents of this file may be used under the terms of 00032 either the GNU General Public License Version 2 or later (the "GPL"), or 00033 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 00034 in which case the provisions of the GPL or the LGPL are applicable instead 00035 of those above. If you wish to allow use of your version of this file only 00036 under the terms of either the GPL or the LGPL, and not to allow others to 00037 use your version of this file under the terms of the MPL, indicate your 00038 decision by deleting the provisions above and replace them with the notice 00039 and other provisions required by the GPL or the LGPL. If you do not delete 00040 the provisions above, a recipient may use your version of this file under 00041 the terms of any one of the MPL, the GPL or the LGPL. 00042 00043 */ 00044 00045 00052 #ifndef _GG_XML_H 00053 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00054 #define _GG_XML_H 00055 #endif 00056 00057 #ifdef __cplusplus 00058 extern "C" 00059 { 00060 #endif 00061 00062 /* constant values for XmlBLOB */ 00063 00065 #define GAIA_XML_START 0x00 00066 00067 #define GAIA_XML_END 0xDD 00068 00069 #define GAIA_XML_HEADER 0xAC 00070 00071 #define GAIA_XML_LEGACY_HEADER 0xAB 00072 00073 #define GAIA_XML_SCHEMA 0xBA 00074 00075 #define GAIA_XML_FILEID 0xCA 00076 00077 #define GAIA_XML_PARENTID 0xDA 00078 00079 #define GAIA_XML_NAME 0xDE 00080 00081 #define GAIA_XML_TITLE 0xDB 00082 00083 #define GAIA_XML_ABSTRACT 0xDC 00084 00085 #define GAIA_XML_GEOMETRY 0xDD 00086 00087 #define GAIA_XML_CRC32 0xBC 00088 00089 #define GAIA_XML_PAYLOAD 0xCB 00090 00091 /* bitmasks for XmlBLOB-FLAG */ 00092 00094 #define GAIA_XML_LITTLE_ENDIAN 0x01 00095 00096 #define GAIA_XML_COMPRESSED 0x02 00097 00098 #define GAIA_XML_VALIDATED 0x04 00099 00100 #define GAIA_XML_ISO_METADATA 0x80 00101 00102 #define GAIA_XML_SLD_SE_RASTER_STYLE 0x10 00103 00104 #define GAIA_XML_SLD_SE_VECTOR_STYLE 0x40 00105 00106 #define GAIA_XML_SLD_STYLE 0x48 00107 00108 #define GAIA_XML_SVG 0x20 00109 00110 00111 /* function prototypes */ 00112 00113 #ifndef DOXYGEN_SHOULD_IGNORE_THIS 00114 #ifdef ENABLE_LIBXML2 /* LIBXML2 enabled: supporting XML documents */ 00115 #endif 00116 00126 GAIAGEO_DECLARE char *gaia_libxml2_version (void); 00127 00152 GAIAGEO_DECLARE void gaiaXmlToBlob (const void *p_cache, 00153 const unsigned char *xml, int xml_len, 00154 int compressed, const char *schemaURI, 00155 unsigned char **result, int *size, 00156 char **parsing_errors, 00157 char **schema_validation_errors); 00158 00180 GAIAGEO_DECLARE char *gaiaXmlTextFromBlob (const unsigned char *blob, 00181 int size, int indent); 00182 00205 GAIAGEO_DECLARE void gaiaXmlFromBlob (const unsigned char *blob, 00206 int size, int indent, 00207 unsigned char **result, 00208 int *res_size); 00209 00223 GAIAGEO_DECLARE int gaiaIsValidXmlBlob (const unsigned char *blob, 00224 int size); 00225 00239 GAIAGEO_DECLARE int gaiaIsCompressedXmlBlob (const unsigned char *blob, 00240 int size); 00241 00255 GAIAGEO_DECLARE int gaiaIsIsoMetadataXmlBlob (const unsigned char *blob, 00256 int size); 00257 00271 GAIAGEO_DECLARE int gaiaIsSldSeVectorStyleXmlBlob (const unsigned char 00272 *blob, int size); 00273 00288 GAIAGEO_DECLARE int gaiaIsSldSeRasterStyleXmlBlob (const unsigned char 00289 *blob, int size); 00290 00305 GAIAGEO_DECLARE int gaiaIsSldStyleXmlBlob (const unsigned char 00306 *blob, int size); 00307 00321 GAIAGEO_DECLARE int gaiaIsSvgXmlBlob (const unsigned char *blob, int size); 00322 00339 GAIAGEO_DECLARE void gaiaXmlBlobCompression (const unsigned char *blob, 00340 int in_size, int compressed, 00341 unsigned char **result, 00342 int *out_size); 00343 00358 GAIAGEO_DECLARE int gaiaIsSchemaValidatedXmlBlob (const unsigned char *blob, 00359 int size); 00360 00370 GAIAGEO_DECLARE int gaiaXmlBlobGetDocumentSize (const unsigned char *blob, 00371 int size); 00372 00387 GAIAGEO_DECLARE char *gaiaXmlBlobGetSchemaURI (const unsigned char 00388 *blob, int size); 00389 00405 GAIAGEO_DECLARE char *gaiaXmlGetInternalSchemaURI (const void *p_cache, 00406 const unsigned char *xml, 00407 int xml_len); 00408 00423 GAIAGEO_DECLARE char *gaiaXmlBlobGetFileId (const unsigned char 00424 *blob, int size); 00425 00440 GAIAGEO_DECLARE char *gaiaXmlBlobGetParentId (const unsigned char 00441 *blob, int size); 00442 00460 GAIAGEO_DECLARE int gaiaXmlBlobSetFileId (const void *p_cache, 00461 const unsigned char *blob, 00462 int size, const char *identifier, 00463 unsigned char **new_blob, 00464 int *new_size); 00465 00483 GAIAGEO_DECLARE int gaiaXmlBlobSetParentId (const void *p_cache, 00484 const unsigned char *blob, 00485 int size, 00486 const char *identifier, 00487 unsigned char **new_blob, 00488 int *new_size); 00489 00511 GAIAGEO_DECLARE int gaiaXmlBlobAddFileId (const void *p_cache, 00512 const unsigned char *blob, 00513 int size, const char *identifier, 00514 const char *ns_id, 00515 const char *uri_id, 00516 const char *ns_charstr, 00517 const char *uri_charstr, 00518 unsigned char **new_blob, 00519 int *new_size); 00520 00542 GAIAGEO_DECLARE int gaiaXmlBlobAddParentId (const void *p_cache, 00543 const unsigned char *blob, 00544 int size, 00545 const char *identifier, 00546 const char *ns_id, 00547 const char *uri_id, 00548 const char *ns_charstr, 00549 const char *uri_charstr, 00550 unsigned char **new_blob, 00551 int *new_size); 00552 00568 GAIAGEO_DECLARE char *gaiaXmlBlobGetName (const unsigned char 00569 *blob, int size); 00570 00586 GAIAGEO_DECLARE char *gaiaXmlBlobGetTitle (const unsigned char 00587 *blob, int size); 00588 00604 GAIAGEO_DECLARE char *gaiaXmlBlobGetAbstract (const unsigned char 00605 *blob, int size); 00606 00623 GAIAGEO_DECLARE void gaiaXmlBlobGetGeometry (const unsigned char 00624 *blob, int size, 00625 unsigned char **blob_geom, 00626 int *blob_size); 00627 00640 GAIAGEO_DECLARE char *gaiaXmlBlobGetEncoding (const unsigned char 00641 *blob, int size); 00642 00657 GAIAGEO_DECLARE char *gaiaXmlBlobGetLastParseError (const void *p_cache); 00658 00673 GAIAGEO_DECLARE char *gaiaXmlBlobGetLastValidateError (const void *p_cache); 00674 00686 GAIAGEO_DECLARE int gaiaIsValidXPathExpression (const void *p_cache, 00687 const char *xpath_expr); 00688 00703 GAIAGEO_DECLARE char *gaiaXmlBlobGetLastXPathError (const void *p_cache); 00704 00721 GAIAGEO_DECLARE int gaiaXmlLoad (const void *p_cache, 00722 const char *path_or_url, 00723 unsigned char **result, int *size, 00724 char **parsing_errors); 00725 00751 GAIAGEO_DECLARE int gaiaXmlStore (const unsigned char *blob, int size, 00752 const char *path, int indent); 00753 00754 #endif /* end LIBXML2: supporting XML documents */ 00755 00756 #ifdef __cplusplus 00757 } 00758 #endif 00759 00760 #endif /* _GG_XML_H */
1.7.3