PageRenderTime 27ms CodeModel.GetById 13ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 1ms

/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Analytics/GDataAnalyticsElements.m

http://macfuse.googlecode.com/
Objective C | 93 lines | 58 code | 16 blank | 19 comment | 5 complexity | d93dde3431967cd73f0dc4a2c2773398 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//  GDataAnalyticsElements.m
18//
19
20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE
21
22#import "GDataAnalyticsConstants.h"
23#import "GDataAnalyticsElements.h"
24
25@implementation GDataAnalyticsDimension
26+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
27+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
28+ (NSString *)extensionElementLocalName { return @"dimension"; }
29@end
30
31@implementation GDataAnalyticsProperty
32+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
33+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
34+ (NSString *)extensionElementLocalName { return @"property"; }
35
36#if !GDATA_SIMPLE_DESCRIPTIONS
37// helper method for displaying descriptions of properties
38+ (NSString *)descriptionItemForProperties:(NSArray *)array {
39
40  NSString *propsDescValue = nil;
41  NSMutableArray *propsDisplayArray = nil;
42
43  // display properties as "(name=value, name2=value2)"
44  for (GDataAnalyticsProperty *prop in array) {
45    NSString *propDisplay = [NSString stringWithFormat:@"%@=%@",
46                             [prop name], [prop stringValue]];
47    if (propsDisplayArray == nil) {
48      propsDisplayArray = [NSMutableArray array];
49    }
50    [propsDisplayArray addObject:propDisplay];
51  }
52
53  if (propsDisplayArray) {
54    propsDescValue = [NSString stringWithFormat:@"(%@)",
55                      [propsDisplayArray componentsJoinedByString:@", "]];
56  }
57  return propsDescValue;
58}
59#endif
60
61@end
62
63@implementation GDataAnalyticsStartDate
64+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
65+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
66+ (NSString *)extensionElementLocalName { return @"startDate"; }
67@end
68
69@implementation GDataAnalyticsEndDate
70+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
71+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
72+ (NSString *)extensionElementLocalName { return @"endDate"; }
73@end
74
75@implementation GDataAnalyticsTableID
76+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
77+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
78+ (NSString *)extensionElementLocalName { return @"tableId"; }
79@end
80
81@implementation GDataAnalyticsTableName
82+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
83+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
84+ (NSString *)extensionElementLocalName { return @"tableName"; }
85@end
86
87@implementation GDataAnalyticsDefinition
88+ (NSString *)extensionElementURI       { return kGDataNamespaceAnalyticsDXP; }
89+ (NSString *)extensionElementPrefix    { return kGDataNamespaceAnalyticsDXPPrefix; }
90+ (NSString *)extensionElementLocalName { return @"definition"; }
91@end
92
93#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_ANALYTICS_SERVICE