axiom_output.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_OUTPUT_H
00019 #define AXIOM_OUTPUT_H
00020 
00026 #include <axis2_utils_defines.h>
00027 #include <axis2_utils.h>
00028 #include <axis2_env.h>
00029 #include <axiom_node.h>
00030 #include <axiom_xml_writer.h>
00031 
00032 #ifdef __cplusplus
00033 extern "C"
00034 {
00035 #endif
00036 
00047     typedef struct axiom_output axiom_output_t;
00048     typedef struct axiom_output_ops axiom_output_ops_t;
00049     struct axiom_text;
00050     
00051  struct axiom_output_ops
00052 {
00060     axis2_status_t (AXIS2_CALL *
00061    free_fn)(axiom_output_t *om_output,
00062              const axis2_env_t *env);
00063     
00070     axis2_bool_t (AXIS2_CALL *
00071    is_soap11)(axiom_output_t *om_output,
00072             const axis2_env_t *env); 
00076    axis2_bool_t (AXIS2_CALL *
00077    is_ignore_xml_declaration)(axiom_output_t *om_output,
00078                         const axis2_env_t *env);                               
00079 
00083    axis2_status_t (AXIS2_CALL *
00084    set_ignore_xml_declaration)(axiom_output_t *om_output,
00085                          const axis2_env_t *env,
00086                          axis2_bool_t ignore_xml_dec); 
00090    axis2_status_t (AXIS2_CALL *
00091    set_soap11)(axiom_output_t *om_output,
00092             const axis2_env_t *env,
00093             axis2_bool_t soap11);
00094                
00098    axis2_status_t (AXIS2_CALL *
00099    set_xml_version)(axiom_output_t *om_output,
00100                 const axis2_env_t *env,
00101                 axis2_char_t *xml_version);
00105    axis2_char_t* (AXIS2_CALL *
00106    get_xml_version)(axiom_output_t *om_output,
00107                 const axis2_env_t *env);  
00111    axis2_status_t (AXIS2_CALL *
00112    set_char_set_encoding)(axiom_output_t *om_output,
00113                      const axis2_env_t *env,
00114                      axis2_char_t *char_set_encoding);
00118    axis2_char_t* (AXIS2_CALL *
00119    get_char_set_encoding)(axiom_output_t *om_output,
00120                      const axis2_env_t *env); 
00124    axis2_status_t (AXIS2_CALL *
00125    set_do_optimize)(axiom_output_t *om_output,
00126                 const axis2_env_t *env,
00127                 axis2_bool_t optimize); 
00128    
00132    axiom_xml_writer_t* (AXIS2_CALL *
00133    get_xml_writer)(axiom_output_t *om_output,
00134                const axis2_env_t *env);                                                                                                                                                  
00141    const axis2_char_t* (AXIS2_CALL *
00142    get_content_type)(axiom_output_t *om_output,
00143                  const axis2_env_t *env);
00144                         
00148    axis2_status_t (AXIS2_CALL *
00149    write_xml_version_encoding)(axiom_output_t *om_output,
00150                          const axis2_env_t *env);
00151 
00155     axis2_bool_t (AXIS2_CALL *
00156     is_optimized)(axiom_output_t *om_output,
00157                   const axis2_env_t *env);                               
00158 
00161     axis2_char_t* (AXIS2_CALL *
00162     get_next_content_id)(axiom_output_t *om_output,
00163                          const axis2_env_t *env);
00164                          
00168     axis2_char_t* (AXIS2_CALL *
00169     get_root_content_id)(axiom_output_t *om_output,
00170                          const axis2_env_t *env);
00171     
00172     
00173     axis2_char_t* (AXIS2_CALL *
00174     get_mime_boundry)(axiom_output_t *om_output,
00175                       const axis2_env_t *env);                       
00176 
00177     axis2_byte_t* (AXIS2_CALL *
00178     flush)(axiom_output_t *om_output,
00179                       const axis2_env_t *env,
00180                       axis2_byte_t **output_stream,
00181                       int *output_stream_size);
00182 
00183                                                   
00184 };  
00185     
00186 
00187 struct axiom_output
00188 {
00189     axiom_output_ops_t *ops;
00190 };
00191     
00192     
00200 AXIS2_EXTERN axiom_output_t* AXIS2_CALL 
00201 axiom_output_create (const axis2_env_t *env,
00202                         axiom_xml_writer_t *xml_writer);
00203 
00204 
00215 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00216 axiom_output_write(axiom_output_t * om_output, 
00217                       const axis2_env_t *env,
00218                       axiom_types_t type,
00219                       int no_of_args, ...);
00220                       
00221 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00222 axiom_output_write_optimized(axiom_output_t *om_output, 
00223                       const axis2_env_t *env, 
00224                       struct axiom_text *om_text);
00225 /************** Macros ********************************************************/
00226 
00227 #define AXIOM_OUTPUT_FREE(output, env) \
00228         ((output)->ops->free_fn(output, env))
00229         
00230 #define AXIOM_OUTPUT_IS_SOAP11(output, env) \
00231         ((output)->ops->is_soap11(output, env))       
00232         
00233 #define AXIOM_OUTPUT_IS_IGNORE_XML_DECLARATION(output, env) \
00234         ((output)->ops->is_ignore_xml_version(output, env)) 
00235         
00236 #define AXIOM_OUTPUT_SET_IGNORE_XML_DECLARATION(output, env, xml_dec) \
00237         ((output)->ops->set_ignore_xml_version(output, env, xml_dec))
00238 
00239 #define AXIOM_OUTPUT_SET_SOAP11(output, env, soap11) \
00240         ((output)->ops->set_soap11(output, env, soap11))
00241         
00242 #define AXIOM_OUTPUT_SET_XML_VERSION(output, env, xml_version) \
00243         ((output)->ops->set_xml_version(output, env, xml_version))
00244         
00245 #define AXIOM_OUTPUT_GET_XML_VERSION(output, env) \
00246         ((output)->ops->get_xml_version(output, env))
00247         
00248 #define AXIOM_OUTPUT_SET_CHAR_SET_ENCODING(output, env, char_set) \
00249         ((output)->ops->set_char_set_encoding(output, env, char_set))
00250         
00251 #define AXIOM_OUTPUT_GET_CHAR_SET_ENCODING(output, env) \
00252         ((output)->ops->get_char_set_encoding(output, env))
00253         
00254 #define AXIOM_OUTPUT_SET_DO_OPTIMIZE(output, env, optimize) \
00255         ((output)->ops->set_do_optimize(output, env, optimize))  
00256         
00257 #define AXIOM_OUTPUT_GET_XML_WRITER(output, env) \
00258         ((output)->ops->get_xml_writer(output, env))
00259         
00260 #define AXIOM_OUTPUT_GET_CONTENT_TYPE(output, env) \
00261         ((output)->ops->get_content_type(output, env))                      
00262 
00263 #define AXIOM_OUTPUT_WRITE_XML_VERSION_ENCODING(output, env) \
00264         ((output)->ops->write_xml_version_encoding(output, env))
00265 
00266 #define AXIOM_OUTPUT_IS_OPTIMIZED(output, env) \
00267         ((output)->ops->is_optimized(output, env))
00268 
00269 #define AXIOM_OUTPUT_GET_NEXT_CONTENT_ID(om_output, env) \
00270         ((om_output)->ops->get_next_content_id(om_output, env))
00271         
00272 #define AXIOM_OUTPUT_GET_ROOT_CONTENT_ID(om_output, env) \
00273         ((om_output)->ops->get_root_content_id(om_output, env))
00274         
00275 #define AXIOM_OUTPUT_GET_MIME_BOUNDRY(om_output, env) \
00276         ((om_output)->ops->get_mime_boundry(om_output, env))                
00277 
00278 #define AXIOM_OUTPUT_FLUSH(om_output, env, output_stream, output_stream_size) \
00279         ((om_output)->ops->flush(om_output, env, output_stream, output_stream_size))                
00280 
00282 #ifdef __cplusplus
00283 }
00284 #endif
00285 
00286 #endif                          /* AXIOM_OUTPUT_H */

Generated on Wed Dec 20 20:14:09 2006 for Axis2/C by  doxygen 1.5.1