axutil_date_time.h

Go to the documentation of this file.
00001 
00002 /*
00003  * Licensed to the Apache Software Foundation (ASF) under one or more
00004  * contributor license agreements.  See the NOTICE file distributed with
00005  * this work for additional information regarding copyright ownership.
00006  * The ASF licenses this file to You under the Apache License, Version 2.0
00007  * (the "License"); you may not use this file except in compliance with
00008  * the License.  You may obtain a copy of the License at
00009  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 
00019 #ifndef AXUTIL_DATE_TIME_H
00020 #define AXUTIL_DATE_TIME_H
00021 
00022 #include <axutil_utils_defines.h>
00023 #include <axutil_env.h>
00024 
00030 #ifdef __cplusplus
00031 extern "C"
00032 {
00033 #endif
00034 
00041     typedef struct axutil_date_time axutil_date_time_t;
00042 
00043     typedef enum
00044     {
00045         AXIS2_DATE_TIME_COMP_RES_FAILURE = -1,
00046         AXIS2_DATE_TIME_COMP_RES_UNKNOWN,
00047         AXIS2_DATE_TIME_COMP_RES_EXPIRED,
00048         AXIS2_DATE_TIME_COMP_RES_EQUAL,
00049         AXIS2_DATE_TIME_COMP_RES_NOT_EXPIRED
00050     } axutil_date_time_comp_result_t;
00051 
00057     AXIS2_EXTERN axutil_date_time_t *AXIS2_CALL
00058     axutil_date_time_create(
00059         const axutil_env_t * env);
00060 
00061     /*
00062      * Creates axutil_date_time struct with an additional offset value
00063      * If the offset is a positive value then the time will be in the future
00064      *        offset is 0, then the time will be the current time
00065      *        offset is a negative value then the time is in the past.
00066      * @param env double pointer to environment struct. MUST NOT be NULL
00067      * @param offset the offset from the current time in seconds
00068      * @return pointer to newly created axutil_date_time struct
00069      **/
00070     AXIS2_EXTERN axutil_date_time_t *AXIS2_CALL
00071 
00072     axutil_date_time_create_with_offset(
00073         const axutil_env_t * env,
00074         int offset);
00075 
00082     AXIS2_EXTERN void AXIS2_CALL
00083     axutil_date_time_free(
00084         axutil_date_time_t * date_time,
00085         const axutil_env_t * env);
00086 
00094     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00095     axutil_date_time_deserialize_time(
00096         axutil_date_time_t * date_time,
00097         const axutil_env_t * env,
00098         const axis2_char_t * time_str);
00099 
00107     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00108     axutil_date_time_deserialize_date(
00109         axutil_date_time_t * date_time,
00110         const axutil_env_t * env,
00111         const axis2_char_t * date_str);
00112 
00120     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00121 
00122     axutil_date_time_deserialize_date_time(
00123         axutil_date_time_t * date_time,
00124         const axutil_env_t * env,
00125         const axis2_char_t * date_time_str);
00126 
00139     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00140     axutil_date_time_set_date_time(
00141         axutil_date_time_t * date_time,
00142         const axutil_env_t * env,
00143         int year,
00144         int month,
00145         int date,
00146         int hour,
00147         int min,
00148         int second,
00149         int milliseconds);
00150 
00157     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00158     axutil_date_time_serialize_time(
00159         axutil_date_time_t * date_time,
00160         const axutil_env_t * env);
00161 
00168     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00169     axutil_date_time_serialize_date(
00170         axutil_date_time_t * date_time,
00171         const axutil_env_t * env);
00172 
00179     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00180 
00181     axutil_date_time_serialize_date_time(
00182         axutil_date_time_t * date_time,
00183         const axutil_env_t * env);
00184 
00191     AXIS2_EXTERN int AXIS2_CALL
00192     axutil_date_time_get_year(
00193         axutil_date_time_t * date_time,
00194         const axutil_env_t * env);
00195 
00202     AXIS2_EXTERN int AXIS2_CALL
00203     axutil_date_time_get_month(
00204         axutil_date_time_t * date_time,
00205         const axutil_env_t * env);
00206 
00213     AXIS2_EXTERN int AXIS2_CALL
00214     axutil_date_time_get_date(
00215         axutil_date_time_t * date_time,
00216         const axutil_env_t * env);
00217 
00224     AXIS2_EXTERN int AXIS2_CALL
00225     axutil_date_time_get_hour(
00226         axutil_date_time_t * date_time,
00227         const axutil_env_t * env);
00228 
00235     AXIS2_EXTERN int AXIS2_CALL
00236     axutil_date_time_get_minute(
00237         axutil_date_time_t * date_time,
00238         const axutil_env_t * env);
00239 
00246     AXIS2_EXTERN int AXIS2_CALL
00247     axutil_date_time_get_second(
00248         axutil_date_time_t * date_time,
00249         const axutil_env_t * env);
00250 
00251     AXIS2_EXTERN int AXIS2_CALL
00252     axutil_date_time_get_msec(
00253         axutil_date_time_t * date_time,
00254         const axutil_env_t * env);
00255 
00266     AXIS2_EXTERN axutil_date_time_comp_result_t AXIS2_CALL
00267     axutil_date_time_compare(
00268         axutil_date_time_t * date_time,
00269         const axutil_env_t * env,
00270         axutil_date_time_t * ref);
00271 
00272     AXIS2_EXTERN axutil_date_time_t *AXIS2_CALL
00273     axutil_date_time_utc_to_local(
00274         axutil_date_time_t * date_time,
00275         const axutil_env_t * env,
00276         axis2_bool_t is_positive,
00277         int hour,
00278         int min);
00279 
00280     AXIS2_EXTERN axutil_date_time_t *AXIS2_CALL
00281     axutil_date_time_local_to_utc(
00282         axutil_date_time_t * date_time,
00283         const axutil_env_t * env);
00284 
00285     AXIS2_EXTERN int AXIS2_CALL
00286     axutil_date_time_get_time_zone_hour(
00287         axutil_date_time_t * date_time,
00288         const axutil_env_t * env);
00289 
00290     AXIS2_EXTERN int AXIS2_CALL
00291     axutil_date_time_get_time_zone_minute(
00292         axutil_date_time_t * date_time,
00293         const axutil_env_t * env);
00294 
00295     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
00296     axutil_date_time_is_time_zone_positive(
00297         axutil_date_time_t * date_time,
00298         const axutil_env_t * env);
00299 
00300     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00301     axutil_date_time_set_time_zone(
00302         axutil_date_time_t * date_time,
00303         const axutil_env_t * env,
00304         axis2_bool_t is_positive,
00305         int hour,
00306         int min);
00307 
00308     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00309     axutil_date_time_deserialize_date_time_with_time_zone(
00310         axutil_date_time_t * date_time,
00311         const axutil_env_t * env,
00312         const axis2_char_t * date_time_str);
00313 
00314     AXIS2_EXTERN axis2_status_t AXIS2_CALL
00315     axutil_date_time_deserialize_time_with_time_zone(
00316         axutil_date_time_t * date_time,
00317         const axutil_env_t * env,
00318         const axis2_char_t * time_str);
00319 
00320     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00321     axutil_date_time_serialize_date_time_with_time_zone(
00322         axutil_date_time_t * date_time,
00323         const axutil_env_t * env);
00324 
00325     AXIS2_EXTERN axis2_char_t *AXIS2_CALL
00326     axutil_date_time_serialize_time_with_time_zone(
00327         axutil_date_time_t * date_time,
00328         const axutil_env_t * env);
00329 
00330     AXIS2_EXTERN axis2_bool_t AXIS2_CALL
00331     axutil_date_time_is_utc(
00332         axutil_date_time_t * date_time,
00333         const axutil_env_t * env);
00334 
00335 #ifdef __cplusplus
00336 }
00337 #endif
00338 
00339 #endif                          /* AXIS2_DATE_TIME_H */

Generated on Sat May 3 10:44:34 2008 for Axis2/C by  doxygen 1.5.5