axiom_document.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *      http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef AXIOM_DOCUMENT_H
00019 #define AXIOM_DOCUMENT_H
00020 
00021 #include <axis2_env.h>
00022 #include <axiom_node.h>
00023 #include <axis2_utils_defines.h>
00024 #include <axiom_output.h>
00025 
00026 #ifdef __cplusplus
00027 extern "C"
00028 {
00029 #endif
00030 
00031 
00037 #define CHAR_SET_ENCODING "UTF-8"
00038 #define XML_VERSION   "1.0"
00039 
00040     struct axiom_document; 
00041     struct axiom_document_ops;
00042     struct axiom_stax_builder;
00043 
00054     typedef struct axiom_document_ops
00055     {
00056 
00063         axis2_status_t (AXIS2_CALL *
00064         free) (struct axiom_document *document,
00065                const axis2_env_t *env);
00066 
00073       axiom_node_t* (AXIS2_CALL *
00074       build_next) (struct axiom_document *document,
00075                    const axis2_env_t *env);
00076 
00084         axiom_node_t* (AXIS2_CALL *
00085         get_root_element)(struct axiom_document *document,
00086                           const axis2_env_t *env);
00087 
00096         axis2_status_t (AXIS2_CALL *
00097         set_root_element)(struct axiom_document *document,
00098                           const axis2_env_t *env,
00099                           axiom_node_t *om_node);
00106         axiom_node_t* (AXIS2_CALL *
00107         build_all)(struct axiom_document *document,
00108                    const axis2_env_t *env); 
00114         struct axiom_stax_builder* (AXIS2_CALL *
00115         get_builder)(struct axiom_document *document,
00116                      const axis2_env_t *env);                                                         
00121         axis2_status_t (AXIS2_CALL *
00122         serialize)(struct axiom_document *document,
00123                    const axis2_env_t *env,
00124                    axiom_output_t *om_output);
00125                                                            
00126     } axiom_document_ops_t;
00127 
00132     typedef struct axiom_document
00133     {
00135         axiom_document_ops_t *ops;
00136       
00137     } axiom_document_t;
00138 
00146     AXIS2_EXTERN axiom_document_t * AXIS2_CALL
00147     axiom_document_create (const axis2_env_t *env,
00148                               axiom_node_t * root,
00149                               struct axiom_stax_builder *builder);
00150 
00152 #define AXIOM_DOCUMENT_FREE(document,env) \
00153         ((document)->ops->free(document,env))
00154         
00156 #define AXIOM_DOCUMENT_BUILD_NEXT(document,env) \
00157         ((document)->ops->build_next(document,env))
00158         
00160 #define AXIOM_DOCUMENT_GET_ROOT_ELEMENT(document,env) \
00161         ((document)->ops->get_root_element(document,env))
00162 
00163 #define AXIOM_DOCUMENT_SET_ROOT_ELEMENT(document,env,om_node) \
00164         ((document)->ops->set_root_element(document,env,om_node))
00165                
00167 #define AXIOM_DOCUMENT_BUILD_ALL(document,env) \
00168         ((document)->ops->build_all(document,env))
00169         
00171 #define AXIOM_DOCUMENT_GET_BUILDER(document, env) \
00172         ((document)->ops->get_builder(document, env))
00173         
00175 #define AXIOM_DOCUMENT_SERIALIZE(document, env, om_output) \
00176         ((document)->ops->serialize(document, env, om_output))                
00177 
00180 #ifdef __cplusplus
00181 }
00182 #endif
00183 
00184 #endif /* AXIOM_DOCUMENT_H */

Generated on Wed Dec 20 20:34:49 2006 for Axis2/C by  doxygen 1.5.1