axiom_output.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef AXIOM_OUTPUT_H
00018 #define AXIOM_OUTPUT_H
00019 
00025 #include <axis2_utils_defines.h>
00026 #include <axis2_utils.h>
00027 #include <axis2_env.h>
00028 #include <axiom_node.h>
00029 #include <axiom_xml_writer.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035 
00046     typedef struct axiom_output axiom_output_t;
00047     typedef struct axiom_output_ops axiom_output_ops_t;
00048     struct axiom_text;
00049     
00050  struct axiom_output_ops
00051 {
00059     axis2_status_t (AXIS2_CALL *
00060    free_fn)(axiom_output_t *om_output,
00061              const axis2_env_t *env);
00062     
00069     axis2_bool_t (AXIS2_CALL *
00070    is_soap11)(axiom_output_t *om_output,
00071             const axis2_env_t *env); 
00075    axis2_bool_t (AXIS2_CALL *
00076    is_ignore_xml_declaration)(axiom_output_t *om_output,
00077                         const axis2_env_t *env);                               
00078 
00082    axis2_status_t (AXIS2_CALL *
00083    set_ignore_xml_declaration)(axiom_output_t *om_output,
00084                          const axis2_env_t *env,
00085                          axis2_bool_t ignore_xml_dec); 
00089    axis2_status_t (AXIS2_CALL *
00090    set_soap11)(axiom_output_t *om_output,
00091             const axis2_env_t *env,
00092             axis2_bool_t soap11);
00093                
00097    axis2_status_t (AXIS2_CALL *
00098    set_xml_version)(axiom_output_t *om_output,
00099                 const axis2_env_t *env,
00100                 axis2_char_t *xml_version);
00104    axis2_char_t* (AXIS2_CALL *
00105    get_xml_version)(axiom_output_t *om_output,
00106                 const axis2_env_t *env);  
00110    axis2_status_t (AXIS2_CALL *
00111    set_char_set_encoding)(axiom_output_t *om_output,
00112                      const axis2_env_t *env,
00113                      axis2_char_t *char_set_encoding);
00117    axis2_char_t* (AXIS2_CALL *
00118    get_char_set_encoding)(axiom_output_t *om_output,
00119                      const axis2_env_t *env); 
00123    axis2_status_t (AXIS2_CALL *
00124    set_do_optimize)(axiom_output_t *om_output,
00125                 const axis2_env_t *env,
00126                 axis2_bool_t optimize); 
00127    
00131    axiom_xml_writer_t* (AXIS2_CALL *
00132    get_xml_writer)(axiom_output_t *om_output,
00133                const axis2_env_t *env);                                                                                                                                                  
00140    const axis2_char_t* (AXIS2_CALL *
00141    get_content_type)(axiom_output_t *om_output,
00142                  const axis2_env_t *env);
00143                         
00147    axis2_status_t (AXIS2_CALL *
00148    write_xml_version_encoding)(axiom_output_t *om_output,
00149                          const axis2_env_t *env);
00150 
00154     axis2_bool_t (AXIS2_CALL *
00155     is_optimized)(axiom_output_t *om_output,
00156                   const axis2_env_t *env);                               
00157 
00160     axis2_char_t* (AXIS2_CALL *
00161     get_next_content_id)(axiom_output_t *om_output,
00162                          const axis2_env_t *env);
00163                          
00167     axis2_char_t* (AXIS2_CALL *
00168     get_root_content_id)(axiom_output_t *om_output,
00169                          const axis2_env_t *env);
00170     
00171     
00172     axis2_char_t* (AXIS2_CALL *
00173     get_mime_boundry)(axiom_output_t *om_output,
00174                       const axis2_env_t *env);                       
00175 
00176     axis2_byte_t* (AXIS2_CALL *
00177     flush)(axiom_output_t *om_output,
00178                       const axis2_env_t *env,
00179                       axis2_byte_t **output_stream,
00180                       int *output_stream_size);
00181 
00182                                                   
00183 };  
00184     
00185 
00186 struct axiom_output
00187 {
00188     axiom_output_ops_t *ops;
00189 };
00190     
00191     
00199 AXIS2_EXTERN axiom_output_t* AXIS2_CALL 
00200 axiom_output_create (const axis2_env_t *env,
00201                         axiom_xml_writer_t *xml_writer);
00202 
00203 
00214 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00215 axiom_output_write(axiom_output_t * om_output, 
00216                       const axis2_env_t *env,
00217                       axiom_types_t type,
00218                       int no_of_args, ...);
00219                       
00220 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00221 axiom_output_write_optimized(axiom_output_t *om_output, 
00222                       const axis2_env_t *env, 
00223                       struct axiom_text *om_text);
00224 /************** Macros ********************************************************/
00225 
00226 #define AXIOM_OUTPUT_FREE(output, env) \
00227         ((output)->ops->free_fn(output, env))
00228         
00229 #define AXIOM_OUTPUT_IS_SOAP11(output, env) \
00230         ((output)->ops->is_soap11(output, env))       
00231         
00232 #define AXIOM_OUTPUT_IS_IGNORE_XML_DECLARATION(output, env) \
00233         ((output)->ops->is_ignore_xml_version(output, env)) 
00234         
00235 #define AXIOM_OUTPUT_SET_IGNORE_XML_DECLARATION(output, env, xml_dec) \
00236         ((output)->ops->set_ignore_xml_version(output, env, xml_dec))
00237 
00238 #define AXIOM_OUTPUT_SET_SOAP11(output, env, soap11) \
00239         ((output)->ops->set_soap11(output, env, soap11))
00240         
00241 #define AXIOM_OUTPUT_SET_XML_VERSION(output, env, xml_version) \
00242         ((output)->ops->set_xml_version(output, env, xml_version))
00243         
00244 #define AXIOM_OUTPUT_GET_XML_VERSION(output, env) \
00245         ((output)->ops->get_xml_version(output, env))
00246         
00247 #define AXIOM_OUTPUT_SET_CHAR_SET_ENCODING(output, env, char_set) \
00248         ((output)->ops->set_char_set_encoding(output, env, char_set))
00249         
00250 #define AXIOM_OUTPUT_GET_CHAR_SET_ENCODING(output, env) \
00251         ((output)->ops->get_char_set_encoding(output, env))
00252         
00253 #define AXIOM_OUTPUT_SET_DO_OPTIMIZE(output, env, optimize) \
00254         ((output)->ops->set_do_optimize(output, env, optimize))  
00255         
00256 #define AXIOM_OUTPUT_GET_XML_WRITER(output, env) \
00257         ((output)->ops->get_xml_writer(output, env))
00258         
00259 #define AXIOM_OUTPUT_GET_CONTENT_TYPE(output, env) \
00260         ((output)->ops->get_content_type(output, env))                      
00261 
00262 #define AXIOM_OUTPUT_WRITE_XML_VERSION_ENCODING(output, env) \
00263         ((output)->ops->write_xml_version_encoding(output, env))
00264 
00265 #define AXIOM_OUTPUT_IS_OPTIMIZED(output, env) \
00266         ((output)->ops->is_optimized(output, env))
00267 
00268 #define AXIOM_OUTPUT_GET_NEXT_CONTENT_ID(om_output, env) \
00269         ((om_output)->ops->get_next_content_id(om_output, env))
00270         
00271 #define AXIOM_OUTPUT_GET_ROOT_CONTENT_ID(om_output, env) \
00272         ((om_output)->ops->get_root_content_id(om_output, env))
00273         
00274 #define AXIOM_OUTPUT_GET_MIME_BOUNDRY(om_output, env) \
00275         ((om_output)->ops->get_mime_boundry(om_output, env))                
00276 
00277 #define AXIOM_OUTPUT_FLUSH(om_output, env, output_stream, output_stream_size) \
00278         ((om_output)->ops->flush(om_output, env, output_stream, output_stream_size))                
00279 
00281 #ifdef __cplusplus
00282 }
00283 #endif
00284 
00285 #endif                          /* AXIOM_OUTPUT_H */

Generated on Tue Oct 3 20:47:58 2006 for Axis2/C by  doxygen 1.4.7