/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. // GDataDateTime.h
  17. //
  18. #import <Foundation/Foundation.h>
  19. #import "GDataDefines.h"
  20. @interface GDataDateTime : NSObject <NSCopying> {
  21. NSDateComponents *dateComponents_;
  22. NSInteger offsetSeconds_; // may be NSUndefinedDateComponent
  23. BOOL isUniversalTime_; // preserves "Z"
  24. NSTimeZone *timeZone_; // specific time zone by name, if known
  25. }
  26. // Note: Nil can be passed for time zone arguments when the time zone is not
  27. // known.
  28. + (GDataDateTime *)dateTimeWithRFC3339String:(NSString *)str;
  29. + (GDataDateTime *)dateTimeWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz;
  30. - (id)initWithRFC3339String:(NSString *)str;
  31. - (id)initWithDate:(NSDate *)date timeZone:(NSTimeZone *)tz;
  32. - (void)setFromDate:(NSDate *)date timeZone:(NSTimeZone *)tz;
  33. - (void)setFromRFC3339String:(NSString *)str;
  34. - (NSDate *)date;
  35. - (NSCalendar *)calendar;
  36. - (NSTimeZone *)timeZone;
  37. - (void)setTimeZone:(NSTimeZone *)timeZone;
  38. - (void)setTimeZone:(NSTimeZone *)timeZone withOffsetSeconds:(NSInteger)val;
  39. - (NSString *)RFC3339String;
  40. - (NSString *)stringValue; // same as RFC3339String
  41. - (BOOL)hasTime;
  42. - (void)setHasTime:(BOOL)shouldHaveTime;
  43. - (NSInteger)offsetSeconds;
  44. - (void)setOffsetSeconds:(NSInteger)val;
  45. - (BOOL)isUniversalTime;
  46. - (void)setIsUniversalTime:(BOOL)flag;
  47. - (NSDateComponents *)dateComponents;
  48. - (void)setDateComponents:(NSDateComponents *)dateComponents;
  49. @end