PageRenderTime 62ms CodeModel.GetById 52ms app.highlight 8ms RepoModel.GetById 0ms app.codeStats 1ms

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