PageRenderTime 40ms CodeModel.GetById 31ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Elements/GDataDateTime.h

http://macfuse.googlecode.com/
C++ Header | 64 lines | 30 code | 15 blank | 19 comment | 0 complexity | 5c4b2d4c44e37aaec9dc7e9b8e1f3522 MD5 | raw file
 1/* Copyright (c) 2007 Google Inc.
 2*
 3* Licensed under the Apache License, Version 2.0 (the "License");
 4* you may not use this file except in compliance with the License.
 5* You may obtain a copy of the License at
 6*
 7*     http://www.apache.org/licenses/LICENSE-2.0
 8*
 9* Unless required by applicable law or agreed to in writing, software
10* distributed under the License is distributed on an "AS IS" BASIS,
11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12* See the License for the specific language governing permissions and
13* limitations under the License.
14*/
15
16//
17//  GDataDateTime.h
18//
19
20#import <Foundation/Foundation.h>
21#import "GDataDefines.h"
22
23@interface GDataDateTime : NSObject <NSCopying> {
24  NSDateComponents *dateComponents_;
25  NSInteger offsetSeconds_; // may be NSUndefinedDateComponent
26  BOOL isUniversalTime_; // preserves "Z"
27  NSTimeZone *timeZone_; // specific time zone by name, if known
28}
29
30// Note: Nil can be passed for time zone arguments when the time zone is not
31//       known.
32
33+ (GDataDateTime *)dateTimeWithRFC3339String:(NSString *)str;
34+ (GDataDateTime *)dateTimeWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz;
35
36- (id)initWithRFC3339String:(NSString *)str;
37- (id)initWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz;
38
39- (void)setFromDate:(NSDate *)date timeZone:(NSTimeZone *)tz;
40- (void)setFromRFC3339String:(NSString *)str;
41
42- (NSDate *)date;
43- (NSCalendar *)calendar;
44
45- (NSTimeZone *)timeZone;
46- (void)setTimeZone:(NSTimeZone *)timeZone;
47- (void)setTimeZone:(NSTimeZone *)timeZone withOffsetSeconds:(NSInteger)val;
48
49- (NSString *)RFC3339String;
50- (NSString *)stringValue; // same as RFC3339String
51
52- (BOOL)hasTime;
53- (void)setHasTime:(BOOL)shouldHaveTime;
54
55- (NSInteger)offsetSeconds;
56- (void)setOffsetSeconds:(NSInteger)val;
57
58- (BOOL)isUniversalTime;
59- (void)setIsUniversalTime:(BOOL)flag;
60
61- (NSDateComponents *)dateComponents;
62- (void)setDateComponents:(NSDateComponents *)dateComponents;
63
64@end