axutil_date_time.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 AXUTIL_DATE_TIME_H
00019 #define AXUTIL_DATE_TIME_H
00020 
00021 #include <axutil_utils_defines.h>
00022 #include <axutil_env.h>
00023 
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033 
00040     typedef struct axutil_date_time axutil_date_time_t;
00041 
00042 
00043     typedef enum  {
00044         AXIS2_DATE_TIME_COMP_RES_FAILURE = -1,
00045         AXIS2_DATE_TIME_COMP_RES_UNKNOWN,
00046         AXIS2_DATE_TIME_COMP_RES_EXPIRED,
00047         AXIS2_DATE_TIME_COMP_RES_EQUAL,
00048         AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED
00049     }axutil_date_time_comp_result_t; 
00050 
00056     AXIS2_EXTERN axutil_date_time_t * AXIS2_CALL
00057     axutil_date_time_create(const axutil_env_t *env);
00058 
00059     /*
00060      * Creates axutil_date_time struct with an additional offset value
00061      * If the offset is a positive value then the time will be in the future
00062      *        offset is 0, then the time will be the current time
00063      *        offset is a negative value then the time is in the past.
00064      * @param env double pointer to environment struct. MUST NOT be NULL
00065      * @param offset the offset from the current time in seconds
00066      * @return pointer to newly created axutil_date_time struct
00067      **/
00068     AXIS2_EXTERN axutil_date_time_t * AXIS2_CALL
00069     axutil_date_time_create_with_offset(const axutil_env_t *env, int offset);
00070 
00077     AXIS2_EXTERN void AXIS2_CALL 
00078     axutil_date_time_free(axutil_date_time_t *date_time,
00079         const axutil_env_t *env);
00080 
00088     AXIS2_EXTERN axis2_status_t AXIS2_CALL 
00089     axutil_date_time_deserialize_time(axutil_date_time_t *date_time,
00090         const axutil_env_t *env,
00091         const axis2_char_t* time_str);
00092 
00100     AXIS2_EXTERN axis2_status_t AXIS2_CALL 
00101     axutil_date_time_deserialize_date(axutil_date_time_t *date_time,
00102         const axutil_env_t *env,
00103         const axis2_char_t* date_str);
00104 
00112     AXIS2_EXTERN axis2_status_t AXIS2_CALL 
00113     axutil_date_time_deserialize_date_time(axutil_date_time_t *date_time,
00114         const axutil_env_t *env,
00115         const axis2_char_t* date_time_str);
00116 
00129     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00130     axutil_date_time_set_date_time(axutil_date_time_t* date_time,
00131         const axutil_env_t *env,
00132         int year, int month, int date,
00133         int hour, int min, int second, int milliseconds);
00134 
00141     AXIS2_EXTERN axis2_char_t* AXIS2_CALL 
00142     axutil_date_time_serialize_time(axutil_date_time_t *date_time,
00143         const axutil_env_t *env);
00144 
00151     AXIS2_EXTERN axis2_char_t* AXIS2_CALL 
00152     axutil_date_time_serialize_date(axutil_date_time_t *date_time,
00153         const axutil_env_t *env);
00154 
00161     AXIS2_EXTERN axis2_char_t* AXIS2_CALL 
00162     axutil_date_time_serialize_date_time(axutil_date_time_t *date_time,
00163         const axutil_env_t *env);
00164 
00171     AXIS2_EXTERN int AXIS2_CALL 
00172     axutil_date_time_get_year(axutil_date_time_t *date_time,
00173         const axutil_env_t *env);
00174 
00181     AXIS2_EXTERN int AXIS2_CALL 
00182     axutil_date_time_get_month(axutil_date_time_t *date_time,
00183         const axutil_env_t *env);
00184 
00191     AXIS2_EXTERN int AXIS2_CALL 
00192     axutil_date_time_get_date(axutil_date_time_t *date_time,
00193         const axutil_env_t *env);
00194 
00201     AXIS2_EXTERN int AXIS2_CALL 
00202     axutil_date_time_get_hour(axutil_date_time_t *date_time,
00203         const axutil_env_t *env);
00204 
00211     AXIS2_EXTERN int AXIS2_CALL 
00212     axutil_date_time_get_minute(axutil_date_time_t *date_time,
00213         const axutil_env_t *env);
00214 
00221     AXIS2_EXTERN int AXIS2_CALL 
00222     axutil_date_time_get_second(axutil_date_time_t *date_time,
00223         const axutil_env_t *env);
00224 
00225     AXIS2_EXTERN int AXIS2_CALL 
00226     axutil_date_time_get_msec(axutil_date_time_t *date_time,
00227         const axutil_env_t *env);
00238     AXIS2_EXTERN axutil_date_time_comp_result_t AXIS2_CALL
00239     axutil_date_time_compare(axutil_date_time_t *date_time,   
00240         const axutil_env_t *env, axutil_date_time_t *ref);
00241 
00242 #ifdef __cplusplus
00243 }
00244 #endif
00245 
00246 #endif /* AXIS2_DATE_TIME_H */

Generated on Thu May 3 12:31:01 2007 for Axis2/C by  doxygen 1.4.6