PageRenderTime 19ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Elements/GDataGenerator.m

http://macfuse.googlecode.com/
Objective C | 80 lines | 41 code | 20 blank | 19 comment | 0 complexity | ba699cd063a42ae07cf1e4bb5e4a0b7f MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, GPL-2.0
  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. // GDataGenerator.m
  17. //
  18. #import "GDataGenerator.h"
  19. static NSString* const kVersionAttr = @"version";
  20. static NSString* const kURIAttr = @"uri";
  21. @implementation GDataGenerator
  22. // Feed generator element, as in
  23. // <generator version='1.0' uri='http://www.google.com/calendar/'>CL2</generator>
  24. + (NSString *)extensionElementURI { return kGDataNamespaceAtom; }
  25. + (NSString *)extensionElementPrefix { return kGDataNamespaceAtomPrefix; }
  26. + (NSString *)extensionElementLocalName { return @"generator"; }
  27. + (GDataGenerator *)generatorWithName:(NSString *)name
  28. version:(NSString *)version
  29. URI:(NSString *)uri {
  30. GDataGenerator *obj = [self object];
  31. [obj setName:name];
  32. [obj setVersion:version];
  33. [obj setURI:uri];
  34. return obj;
  35. }
  36. - (void)addParseDeclarations {
  37. NSArray *attrs = [NSArray arrayWithObjects:
  38. kVersionAttr, kURIAttr, nil];
  39. [self addLocalAttributeDeclarations:attrs];
  40. [self addContentValueDeclaration];
  41. }
  42. - (NSString *)name {
  43. return [self contentStringValue];
  44. }
  45. - (void)setName:(NSString *)str {
  46. [self setContentStringValue:str];
  47. }
  48. - (NSString *)version {
  49. return [self stringValueForAttribute:kVersionAttr];
  50. }
  51. - (void)setVersion:(NSString *)str {
  52. [self setStringValue:str forAttribute:kVersionAttr];
  53. }
  54. - (NSString *)URI {
  55. return [self stringValueForAttribute:kURIAttr];
  56. }
  57. - (void)setURI:(NSString *)str {
  58. [self setStringValue:str forAttribute:kURIAttr];
  59. }
  60. @end