/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Analytics/GDataAnalyticsStep.m

http://macfuse.googlecode.com/ · Objective C · 74 lines · 39 code · 18 blank · 17 comment · 1 complexity · 538f7b212b7ad405a6aabb64d3c2464a MD5 · raw file

  1. /* Copyright (c) 2009 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. // GDataAnalyticsStep.m
  17. //
  18. #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE
  19. #import "GDataAnalyticsStep.h"
  20. #import "GDataAnalyticsConstants.h"
  21. static NSString *const kNameAttr = @"name";
  22. static NSString *const kNumberAttr = @"number";
  23. static NSString *const kPathAttr = @"path";
  24. @implementation GDataAnalyticsStep
  25. + (NSString *)extensionElementURI { return kGDataNamespaceAnalyticsGA; }
  26. + (NSString *)extensionElementPrefix { return kGDataNamespaceAnalyticsGAPrefix; }
  27. + (NSString *)extensionElementLocalName { return @"step"; }
  28. - (void)addParseDeclarations {
  29. NSArray *attrs = [NSArray arrayWithObjects:
  30. kNameAttr, kNumberAttr, kPathAttr, nil];
  31. [self addLocalAttributeDeclarations:attrs];
  32. }
  33. #pragma mark -
  34. - (NSString *)name {
  35. NSString *str = [self stringValueForAttribute:kNameAttr];
  36. return str;
  37. }
  38. - (void)setName:(NSString *)str {
  39. [self setStringValue:str forAttribute:kNameAttr];
  40. }
  41. - (NSNumber *)number { // int
  42. NSNumber *num = [self intNumberForAttribute:kNumberAttr];
  43. return num;
  44. }
  45. - (void)setNumber:(NSNumber *)num {
  46. [self setStringValue:[num stringValue] forAttribute:kNumberAttr];
  47. }
  48. - (NSString *)path {
  49. NSString *str = [self stringValueForAttribute:kPathAttr];
  50. return str;
  51. }
  52. - (void)setPath:(NSString *)str {
  53. [self setStringValue:str forAttribute:kPathAttr];
  54. }
  55. @end
  56. #endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE