⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcoxml.h

📁 PB 熟悉的哥们希望大家可以互相学习一下
💻 H
字号:
/*******************************************************************
 *                                                                 *
 *  mcoxml.h                                                       *
 *                                                                 *
 *  This file is a part of the eXtremeDB source code               *
 *  Copyright (c) 2001-2007 McObject LLC                           * 
 *  All Rights Reserved                                            *
 *                                                                 *
 *******************************************************************/

#ifndef MCO_XML_H__
    #define MCO_XML_H__

    /*
     * ++
     * 
     * PROJECT:   eXtremeDB(tm) (c) McObject LLC
     *
     * SUBSYSTEM: XML support
     *
     * MODULE:    MCOXML.H
     *
     * ABSTRACT:  Header file of data xml i/o
     *
     *
     * VERSION:   1.0
     *
     * HISTORY:
     *            1.0- 1 AD     08-Aug-2002 Created it was (xml output)
     *                 2 AD     19-Aug-2002 added Base64 encoding
     *                 3 AD     28-Aug-2002 XML parsing was created
     *                 4 AD     05-Sep-2002 Added flagsfor string coding
     *                   TP     27-Sep-2003 Alternative XML representation
     *			
     *
     * --
     */

    #ifdef __cplusplus
        extern "C"
        {
        #endif 

        #include "mco.h"

        /*
         * Error codes for XML subsystem
         */
        #define MCO_E_XML_INVINT      MCO_ERR_XML_W+1 /* invalid integer                                */
        #define MCO_E_XML_INVFLT      MCO_ERR_XML_W+2 /* invalid float                                  */
        #define MCO_E_XML_INTOVF      MCO_ERR_XML_W+3 /* integer overflow                               */
        #define MCO_E_XML_INVBASE     MCO_ERR_XML_W+4 /* invalid base for quad (10)                     */
        #define MCO_E_XML_BUFSMALL    MCO_ERR_XML_W+5 /* buffer too small for double                    */
        /* in fixed point format                          */
        #define MCO_E_XML_VECTUNSUP   MCO_ERR_XML_W+6 /* unsupported base type for vector               */
        #define MCO_E_XML_INVPOLICY   MCO_ERR_XML_W+7 /* invalid xml policy value                       */

        #define MCO_E_XML_INVCLASS    MCO_ERR_XML_W+21/* obj class & xml class not the same             */
        #define MCO_E_XML_NO_OID      MCO_ERR_XML_W+22/* first field in xml object MUST be OID          */
        #define MCO_E_XML_INVOID      MCO_ERR_XML_W+23/* invalid data in OID field (hex code)           */
        #define MCO_E_XML_INVFLDNAME  MCO_ERR_XML_W+24/* invalid field name                             */
        #define MCO_E_XML_FLDNOTFOUND MCO_ERR_XML_W+25/* specified field was not found                  */
        #define MCO_E_XML_INVENDTAG   MCO_ERR_XML_W+26/* invalid closing tag name                       */
        #define MCO_E_XML_UPDID       MCO_ERR_XML_W+27/* cannot update OID or AUTOID                    */
        #define MCO_E_XML_INVASCII    MCO_ERR_XML_W+28/* invalid xml coding in ascii string             */
        #define MCO_E_XML_INCOMPL     MCO_ERR_XML_W+29/* xml data incomplete (closing tag not found)    */
        #define MCO_E_XML_ARRSMALL    MCO_ERR_XML_W+30/* array is not large enough to hold all elements */
        #define MCO_E_XML_INVARREL    MCO_ERR_XML_W+31/* invalid name of array element                  */
        #define MCO_E_XML_EXTRAXML    MCO_ERR_XML_W+32/* extra xml found after parsing                  */
        #define MCO_E_XML_NOTWF       MCO_ERR_XML_W+33/* not well-formed xml                            */
        #define MCO_E_XML_UNICODE     MCO_ERR_XML_W+34/* bad unicode conversion                         */

        /*
         * Data format policy
         */
        typedef enum MCO_NUM_BASE_E
        {
            MCO_NUM_OCT = 8, MCO_NUM_DEC = 10, MCO_NUM_HEX = 16
        } MCO_NUM_BASE;

        typedef enum MCO_TEXT_CODING_E
        {
            MCO_TEXT_ASCII = 1, MCO_TEXT_BINHEX = 2, MCO_TEXT_BASE64 = 3
        } MCO_TEXT_CODING;

        typedef enum MCO_FLOAT_FORMAT_E
        {
            MCO_FLOAT_FIXED = 1, MCO_FLOAT_EXPONENT = 2
        } MCO_FLOAT_FORMAT;

        typedef struct mco_xml_policy_t_
        {
            MCO_NUM_BASE int_base;
            MCO_NUM_BASE quad_base;
            MCO_TEXT_CODING text_coding;
            MCO_TEXT_CODING blob_coding;
            MCO_FLOAT_FORMAT float_format;
            mco_bool indent;
            mco_bool ignore_field; /* ignore field in xml, that is not in class         */
            mco_bool encode_spec; /* encode chars with code < 32, except LF            */
            mco_bool encode_lf; /* encode line feeds                                 */
            mco_bool encode_nat; /* encode national chars (code > 127)                */
            mco_bool truncate_sp; /* truncate trailing spaces in chars                 */
            mco_bool use_xml_attrs; /* alternative XML representation, using atributes   */
            mco_bool ignore_autoid; /* ignore autoid value in put and create operations  */
            mco_bool ignore_autooid; /* pass auto_oid in get/put/create operations        */
        } mco_xml_policy_t;

        void mco_xml_get_default_policy( /*OUT*/mco_xml_policy_t* p);
        MCO_RET mco_xml_get_policy(mco_trans_h t,  /*OUT*/mco_xml_policy_t* p);
        MCO_RET mco_xml_set_policy(mco_trans_h t, const mco_xml_policy_t* p);

        MCO_RET mco_db_xml_export(mco_trans_h t, void* stream_handle, mco_stream_write output_stream_writer);
        MCO_RET mco_db_xml_import(mco_trans_h t, void* stream_handle, mco_stream_read input_stream_reader);

        #ifdef __cplusplus
        }
    #endif 


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -