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

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Docs/GDataDocConstants.m

http://macfuse.googlecode.com/
Objective C | 57 lines | 23 code | 14 blank | 20 comment | 3 complexity | e35fb0f5707259403c58d2103c67f43f 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//  GDataDocConstants.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE
21
22#define GDATADOCCONSTANTS_DEFINE_GLOBALS 1
23#import "GDataDocConstants.h"
24
25#import "GDataEntryBase.h"
26
27@implementation GDataDocConstants
28
29+ (NSString *)coreProtocolVersionForServiceVersion:(NSString *)serviceVersion {
30  // Docs     v1: core v1
31  //          v2:      v2
32  //          v3:      v2
33  NSComparisonResult result = [GDataUtilities compareVersion:serviceVersion
34                                                   toVersion:@"2.0"];
35  if (result != NSOrderedAscending) {
36    return @"2.0";
37  }
38  return @"1.0";
39}
40
41
42+ (NSDictionary *)baseDocumentNamespaces {
43
44  NSMutableDictionary *namespaces;
45
46  namespaces = [NSMutableDictionary dictionaryWithDictionary:
47    [GDataEntryBase baseGDataNamespaces]];
48
49  [namespaces setObject:kGDataNamespaceDocuments
50                 forKey:kGDataNamespaceDocumentsPrefix];
51
52  return namespaces;
53}
54
55@end
56
57#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_DOCS_SERVICE