PageRenderTime 14ms CodeModel.GetById 1ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Elements/GDataBatchOperation.m

http://macfuse.googlecode.com/
Objective C | 55 lines | 23 code | 13 blank | 19 comment | 0 complexity | c37de38f66900109e8061154c60bf4b1 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//  GDataBatchOperation.m
18//
19
20#define GDATABATCH_DEFINE_GLOBALS 1
21#import "GDataBatchOperation.h"
22
23static NSString* const kTypeAttr = @"type";
24
25@implementation GDataBatchOperation
26// for batch operations, like
27//  <batch:operation type="insert"/>
28
29+ (NSString *)extensionElementURI       { return kGDataNamespaceBatch; }
30+ (NSString *)extensionElementPrefix    { return kGDataNamespaceBatchPrefix; }
31+ (NSString *)extensionElementLocalName { return @"operation"; }
32
33+ (GDataBatchOperation *)batchOperationWithType:(NSString *)type {
34  GDataBatchOperation* obj = [self object];
35  [obj setType:type];
36  return obj;
37}
38
39- (void)addParseDeclarations {
40
41  NSArray *attrs = [NSArray arrayWithObject:kTypeAttr];
42
43  [self addLocalAttributeDeclarations:attrs];
44}
45
46- (NSString *)type {
47  return [self stringValueForAttribute:kTypeAttr];
48}
49
50- (void)setType:(NSString *)str {
51  [self setStringValue:str forAttribute:kTypeAttr];
52}
53
54@end
55