PageRenderTime 60ms CodeModel.GetById 22ms app.highlight 34ms RepoModel.GetById 1ms app.codeStats 1ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Media/GDataMediaCategory.m

http://macfuse.googlecode.com/
Objective C | 80 lines | 41 code | 19 blank | 20 comment | 2 complexity | 9e8dcb5ddca565253657900648f3d7fa MD5 | raw file
 1/* Copyright (c) 2008 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//  GDataMediaCategory.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_PHOTOS_SERVICE \
21  || GDATA_INCLUDE_YOUTUBE_SERVICE
22
23#import "GDataMediaCategory.h"
24#import "GDataMediaGroup.h"
25
26static NSString* const kSchemeAttr = @"scheme";
27static NSString* const kLabelAttr = @"label";
28
29@implementation GDataMediaCategory
30// like <media:category scheme="http://search.yahoo.com/mrss/category_schema" label="foo">
31//             music/artist/album/song</media:category>
32// http://search.yahoo.com/mrss
33
34+ (NSString *)extensionElementURI       { return kGDataNamespaceMedia; }
35+ (NSString *)extensionElementPrefix    { return kGDataNamespaceMediaPrefix; }
36+ (NSString *)extensionElementLocalName { return @"category"; }
37
38+ (GDataMediaCategory *)mediaCategoryWithString:(NSString *)str {
39  GDataMediaCategory* obj = [self object];
40  [obj setStringValue:str];
41  return obj;
42}
43
44- (void)addParseDeclarations {
45  
46  NSArray *attrs = [NSArray arrayWithObjects: 
47                    kLabelAttr, kSchemeAttr, nil];
48  
49  [self addLocalAttributeDeclarations:attrs];
50  
51  [self addContentValueDeclaration];
52}
53
54- (NSString *)label {
55  return [self stringValueForAttribute:kLabelAttr];
56}
57
58- (void)setLabel:(NSString *)str {
59  [self setStringValue:str forAttribute:kLabelAttr];
60}
61
62- (NSString *)scheme {
63  return [self stringValueForAttribute:kSchemeAttr];
64}
65
66- (void)setScheme:(NSString *)str {
67  [self setStringValue:str forAttribute:kSchemeAttr];
68}
69
70- (NSString *)stringValue {
71  return [self contentStringValue];
72}
73
74- (void)setStringValue:(NSString *)str {
75  [self setContentStringValue:str];
76}
77
78@end
79
80#endif // #if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_*_SERVICE