00001 /* 00002 * Copyright 2005-2009 WSO2, Inc. http://wso2.com 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 OMDATAHANDLER_H 00018 #define OMDATAHANDLER_H 00019 00020 #include <WSFDefines.h> 00021 #include <axiom_data_handler.h> 00022 00031 namespace wso2wsf 00032 { 00045 class OMDataHandler 00046 { 00047 private: 00052 axiom_data_handler_t * _wsf_axiom_data_handler; 00053 00054 public: 00060 WSF_EXTERN WSF_CALL OMDataHandler(std::string file_name, std::string mime_type); 00061 00066 WSF_EXTERN WSF_CALL OMDataHandler(std::string mime_type); 00067 00071 WSF_EXTERN WSF_CALL OMDataHandler(); 00072 00076 WSF_CALL ~OMDataHandler(); 00077 00082 axiom_data_handler_t * WSF_CALL getAxiomDataHandler(); 00083 00088 void WSF_CALL setAxiomDataHandler(axiom_data_handler_t * data_handler); 00089 00094 WSF_EXTERN std::string WSF_CALL getContentType(); 00095 00100 WSF_EXTERN axis2_byte_t * WSF_CALL getInputStream(); 00101 00106 WSF_EXTERN int WSF_CALL getInputStreamLength(); 00107 00114 WSF_EXTERN bool WSF_CALL read(axis2_byte_t ** output_stream, int * output_stream_length); 00115 00122 WSF_EXTERN bool WSF_CALL write(axis2_byte_t * input_stream, int input_stream_length); 00123 00129 WSF_EXTERN bool WSF_CALL setFileName(std::string file_name); 00134 WSF_EXTERN bool WSF_CALL isCached(); 00140 WSF_EXTERN bool WSF_CALL writeTo(std::string filename); 00141 00142 00143 }; 00145 } 00146 #endif // OMDATAHANDLER_H