PageRenderTime 35ms CodeModel.GetById 2ms app.highlight 29ms RepoModel.GetById 1ms 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
 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//  GDataGenerator.m
18//
19
20#import "GDataGenerator.h"
21
22static NSString* const kVersionAttr = @"version";
23static NSString* const kURIAttr = @"uri";
24
25@implementation GDataGenerator
26// Feed generator element, as in
27//   <generator version='1.0' uri='http://www.google.com/calendar/'>CL2</generator>
28
29+ (NSString *)extensionElementURI       { return kGDataNamespaceAtom; }
30+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAtomPrefix; }
31+ (NSString *)extensionElementLocalName { return @"generator"; }
32
33+ (GDataGenerator *)generatorWithName:(NSString *)name
34                              version:(NSString *)version
35                                  URI:(NSString *)uri {
36  GDataGenerator *obj = [self object];
37  [obj setName:name];
38  [obj setVersion:version];
39  [obj setURI:uri];
40  return obj;
41}
42
43- (void)addParseDeclarations {
44
45  NSArray *attrs = [NSArray arrayWithObjects:
46                    kVersionAttr, kURIAttr, nil];
47
48  [self addLocalAttributeDeclarations:attrs];
49
50  [self addContentValueDeclaration];
51}
52
53- (NSString *)name {
54  return [self contentStringValue];
55}
56
57- (void)setName:(NSString *)str {
58  [self setContentStringValue:str];
59}
60
61- (NSString *)version {
62  return [self stringValueForAttribute:kVersionAttr];
63}
64
65- (void)setVersion:(NSString *)str {
66  [self setStringValue:str forAttribute:kVersionAttr];
67}
68
69- (NSString *)URI {
70  return [self stringValueForAttribute:kURIAttr];
71}
72
73- (void)setURI:(NSString *)str {
74  [self setStringValue:str forAttribute:kURIAttr];
75}
76
77@end
78
79
80