Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Examples

axiom_data_handler.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_DATA_HANDLER_H
00018 #define AXIOM_DATA_HANDLER_H
00019 
00025 #include <axis2_utils.h>
00026 #include <axis2_error.h>
00027 #include <axis2_utils_defines.h>
00028 #include <axis2_env.h>
00029 #include <axis2_allocator.h>
00030 #include <axis2_string.h>
00031 #include <axis2_array_list.h>
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C"
00036 {
00037 #endif
00038 
00039 
00040 /* This should be moved to header file later axis2_defines.h*/    
00041 #define axis2_byte_t char
00042    
00043 typedef struct axiom_data_handler_ops axiom_data_handler_ops_t;
00044 typedef struct axiom_data_handler axiom_data_handler_t;   
00045 
00046 /*
00047       private final DataSource ds;
00048       private final DataFlavor flavor;
00049       private CommandMap commandMap;
00050       private DataContentHandler dch;
00051 */
00052 
00062 struct axiom_data_handler_ops
00063 {
00064    axis2_char_t *(AXIS2_CALL *
00065     get_content_type)(axiom_data_handler_t *data_handler, 
00066         const axis2_env_t *env); 
00067    
00068    axis2_byte_t* (AXIS2_CALL *
00069     get_input_stream)(axiom_data_handler_t *data_handler, 
00070         const axis2_env_t *env); 
00071 
00072     axis2_status_t (AXIS2_CALL *
00073     read_from)(axiom_data_handler_t *data_handler, 
00074         const axis2_env_t *env, 
00075         axis2_byte_t** output_stream, 
00076         int *output_stream_size);
00077 
00078     axis2_status_t (AXIS2_CALL *
00079     set_binary_data)(axiom_data_handler_t *data_handler, 
00080         const axis2_env_t *env, 
00081         axis2_byte_t* input_stream, 
00082         int input_stream_len);
00083 
00084     axis2_status_t (AXIS2_CALL *
00085     write_to)(axiom_data_handler_t *data_handler, 
00086         const axis2_env_t *env);
00087 
00088     axis2_status_t ( AXIS2_CALL *
00089     set_file_name )(
00090         axiom_data_handler_t *data_handler, 
00091         const axis2_env_t *env, 
00092         axis2_char_t* file_name);
00093     
00094     axis2_status_t (AXIS2_CALL *
00095     free) (axiom_data_handler_t *data_handler, 
00096         const axis2_env_t *env);
00097 };
00098 
00103 struct axiom_data_handler
00104 {
00105    axiom_data_handler_ops_t *ops;
00106    
00107    /*
00108     axis2_char_t type;
00109     *void handler;   
00110    */
00111 };
00112 
00117 AXIS2_EXTERN axiom_data_handler_t * AXIS2_CALL 
00118 axiom_data_handler_create (const axis2_env_t *env, 
00119     const axis2_char_t *file_name, 
00120     const axis2_char_t *mime_type);
00121 
00122 /*************************** Function macros **********************************/
00123 
00124 #define AXIOM_DATA_HANDLER_FREE(data_handler, env) \
00125     ((data_handler)->ops->free (data_handler, env))
00126 
00127 #define AXIOM_DATA_HANDLER_GET_CONTENT_TYPE(data_handler, env) \
00128     ((data_handler)->ops->get_content_type (data_handler, env))
00129 
00130 #define AXIOM_DATA_HANDLER_GET_INPUT_STREAM(data_handler, env) \
00131     ((data_handler)->ops->get_input_stream (data_handler, env))
00132 
00133 #define AXIOM_DATA_HANDLER_READ_FROM(data_handler, env, output_stream, output_stream_size) \
00134     ((data_handler)->ops->read_from (data_handler, env, output_stream, output_stream_size))
00135 
00136 #define AXIOM_DATA_HANDLER_SET_BINARY_DATA(data_handler, env, input_stream, input_stream_size) \
00137     ((data_handler)->ops->set_binary_data (data_handler, env, input_stream, input_stream_size))
00138 
00139 #define AXIOM_DATA_HANDLER_WRITE_TO(data_handler, env) \
00140     ((data_handler)->ops->write_to (data_handler, env))
00141 
00142 #define AXIOM_DATA_HANDLER_SET_FILE_NAME(data_handler, env, file_name) \
00143     ((data_handler)->ops->set_file_name (data_handler, env, file_name))
00144 
00145 /*************************** End of function macros ***************************/
00146 
00149 #ifdef __cplusplus
00150 }
00151 #endif
00152 #endif  /* AXIOM_DATA_HANDLER_H */

Generated on Fri Jun 16 18:02:30 2006 for Axis2/C by  doxygen 1.4.2