Axis2/C: axiom_mime_part.h Source File

- Main Page
- Modules
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

# axiom_mime_part.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_MIME_PART_H
    00019 #define AXIOM_MIME_PART_H
    00020
    00026 #include <axutil_utils.h>
    00027 #include <axutil_error.h>
    00028 #include <axutil_utils_defines.h>
    00029 #include <axutil_env.h>
    00030 #include <axutil_allocator.h>
    00031 #include <axutil_string.h>
    00032 #include <axutil_array_list.h>
    00033
    00034 #ifdef __cplusplus
    00035 extern "C"
    00036 {
    00037 #endif
    00038
    00039     typedef struct axiom_mime_part_t axiom_mime_part_t;
    00040
    00041
    00042     /* An enum to keep different mime_part types */
    00043
    00044     typedef enum axiom_mime_part_type_t
    00045     {
    00046
    00048         AXIOM_MIME_PART_BUFFER = 0,
    00049
    00050         /* A file */
    00051         AXIOM_MIME_PART_FILE,
    00052
    00053         /* User specified callback */
    00054         AXIOM_MIME_PART_CALLBACK,
    00055
    00056         /* unknown type*/
    00057         AXIOM_MIME_PART_UNKNOWN
    00058
    00059     } axiom_mime_part_type_t;
    00060
    00061     struct axiom_mime_part_t
    00062     {
    00063         /* This is when the mime part is a buffer.
    00064          * This will be null when the part is a file */
    00065         axis2_byte_t *part;
    00066
    00067         /* This is to keep file name when the part is a file
    00068          * NULL when the part is a buffer */
    00069         axis2_char_t *file_name;
    00070
    00071         /* Size of the part. In the case of buffer this is
    00072          * the buffer size and in the case of file this is
    00073            the file size */
    00074         int part_size;
    00075
    00076         /* This is one from the above defined enum */
    00077         axiom_mime_part_type_t type;
    00078
    00079         /* This is required in the case of the callback */
    00080         void *user_param;
    00081     };
    00082
    00083
    00084
    00085
    00086     AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
    00087     axiom_mime_part_get_content_type_for_mime(
    00088         const axutil_env_t * env,
    00089         axis2_char_t * boundary,
    00090         axis2_char_t * content_id,
    00091         axis2_char_t * char_set_encoding,
    00092         const axis2_char_t * soap_content_type);
    00093
    00094
    00100     AXIS2_EXTERN axiom_mime_part_t *AXIS2_CALL
    00101     axiom_mime_part_create(
    00102         const axutil_env_t *env);
    00103
    00104     /* This method will create the output part
    00105      * list.*/
    00106
    00107     AXIS2_EXTERN axutil_array_list_t  *AXIS2_CALL
    00108     axiom_mime_part_create_part_list(
    00109         const axutil_env_t *env,
    00110         axis2_char_t *soap_body,
    00111         axutil_array_list_t *binary_node_list,
    00112         axis2_char_t *boundary,
    00113         axis2_char_t *content_id,
    00114         axis2_char_t *char_set_encoding,
    00115         const axis2_char_t *soap_content_type);
    00116
    00117
    00118     AXIS2_EXTERN void AXIS2_CALL
    00119     axiom_mime_part_free(
    00120         axiom_mime_part_t *mime_part,
    00121         const axutil_env_t *env);
    00122
    00123
    00124
    00125
    00128 #ifdef __cplusplus
    00129 }
    00130 #endif
    00131 #endif                          /* AXIOM_MIME_PART_H */