/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/Finance/GDataQueryFinance.m
Objective C | 73 lines | 40 code | 16 blank | 17 comment | 1 complexity | 4abb1ea93f8cae69704e4c122d841049 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// GDataQueryFinance.m 18// 19 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE 21 22#import "GDataQueryFinance.h" 23 24#import "GDataServiceGoogleFinance.h" 25 26static NSString *const kReturnsParamName = @"returns"; 27static NSString *const kPositionsParamName = @"positions"; 28static NSString *const kTransactionsParamName = @"transactions"; 29 30@implementation GDataQueryFinance 31 32+ (GDataQueryFinance *)financeQueryWithFeedURL:(NSURL *)feedURL { 33 return [self queryWithFeedURL:feedURL]; 34} 35 36#pragma mark - 37 38- (void)setShouldIncludeReturns:(BOOL)flag { 39 [self addCustomParameterWithName:kReturnsParamName 40 boolValue:flag 41 defaultValue:NO]; 42} 43 44- (BOOL)shouldIncludeReturns { 45 return [self boolValueForParameterWithName:kReturnsParamName 46 defaultValue:NO]; 47} 48 49- (void)setShouldIncludePositions:(BOOL)flag { 50 [self addCustomParameterWithName:kPositionsParamName 51 boolValue:flag 52 defaultValue:NO]; 53} 54 55- (BOOL)shouldIncludePositions { 56 return [self boolValueForParameterWithName:kPositionsParamName 57 defaultValue:NO]; 58} 59 60- (void)setShouldIncludeTransactions:(BOOL)flag { 61 [self addCustomParameterWithName:kTransactionsParamName 62 boolValue:flag 63 defaultValue:NO]; 64} 65 66- (BOOL)shouldIncludeTransactions { 67 return [self boolValueForParameterWithName:kTransactionsParamName 68 defaultValue:NO]; 69} 70 71@end 72 73#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_FINANCE_SERVICE