PageRenderTime 31ms CodeModel.GetById 14ms app.highlight 14ms RepoModel.GetById 2ms app.codeStats 0ms

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

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