00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AXIS2_PROPERTIES_H
00018 #define AXIS2_PROPERTIES_H
00019
00020 #include <axis2_utils_defines.h>
00021 #include <axis2_error.h>
00022 #include <axis2_env.h>
00023 #include <axis2_hash.h>
00024 #include <stdio.h>
00025
00026 #ifdef __cplusplus
00027 extern "C"
00028 {
00029 #endif
00030
00031 typedef struct axis2_properties axis2_properties_t;
00032 typedef struct axis2_properties_ops axis2_properties_ops_t;
00033
00044 struct axis2_properties_ops
00045 {
00053 axis2_status_t (AXIS2_CALL *
00054 free) (axis2_properties_t *properties,
00055 const axis2_env_t *env);
00056
00064 axis2_char_t* (AXIS2_CALL *
00065 get_property) (axis2_properties_t *properties,
00066 const axis2_env_t *env,
00067 axis2_char_t *key);
00077 axis2_status_t (AXIS2_CALL *
00078 set_property) (axis2_properties_t *properties,
00079 const axis2_env_t *env,
00080 axis2_char_t *key,
00081 axis2_char_t *value);
00088 axis2_hash_t* (AXIS2_CALL *
00089 get_all)( axis2_properties_t *properties,
00090 const axis2_env_t *env);
00091
00100 axis2_status_t (AXIS2_CALL *
00101 load)(axis2_properties_t *properties,
00102 const axis2_env_t *env,
00103 FILE *input);
00104
00113 axis2_status_t (AXIS2_CALL *
00114 store)(axis2_properties_t *properites,
00115 const axis2_env_t *env,
00116 FILE *output);
00117 };
00118
00119
00123 struct axis2_properties
00124 {
00125 axis2_properties_ops_t *ops;
00126 };
00127
00132 AXIS2_EXTERN axis2_properties_t * AXIS2_CALL
00133 axis2_properties_create(const axis2_env_t *env);
00134
00135
00136
00137 #define AXIS2_PROPERTIES_FREE(properties, env) \
00138 ((properties)->ops->free (properties, env))
00139
00140 #define AXIS2_PROPERTIES_GET_PROPERTY(properties, env, key) \
00141 ((properties)->ops->get_property(properties, env, key))
00142
00143 #define AXIS2_PROPERTIES_SET_PROPERTY(properties, env, key, value) \
00144 ((properties)->ops->set_property(properties, env, key, value))
00145
00146 #define AXIS2_PROPERTIES_GET_ALL(properties, env) \
00147 ((properties)->ops->get_all(properties, env))
00148
00149 #define AXIS2_PROPERTIES_LOAD(properties, env, input) \
00150 ((properties)->ops->load(properties, env, input))
00151
00152 #define AXIS2_PROPERTIES_STORE(properties, env, output) \
00153 ((properties)->ops->store(properties, env, output))
00154
00155
00156
00157
00158
00161 #ifdef __cplusplus
00162 }
00163 #endif
00164
00165 #endif