Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1057158
needs to be created here
Jun 4, 2011
6e2e72c
singleton for settings
Jun 4, 2011
f909419
method def for default check, run it at start
Jun 4, 2011
2c870b2
make urls a readonly property of the BitcoinMarket class, subclasses …
Jun 4, 2011
4283b47
Merge branch 'master' of https://github.com/seventoes/BitTicker-Mac
Jun 4, 2011
5655d36
fix for posting data in the bitcoinmarket class, turn on wallet fetch…
Jun 5, 2011
13cd0b4
dont fetch wallet if username or password are defaults or null
Jun 5, 2011
0483d82
add wallet class, show wallet info in the menu
Jun 5, 2011
e397762
Fix file references
stith Jun 5, 2011
34cb3fb
Follow naming conventions
stith Jun 5, 2011
a4f76b2
Separate property declarations to prevent merging conflicts (pet peev…
stith Jun 5, 2011
366de81
EMKeychainItem is a model, move it to Models group
stith Jun 5, 2011
1ef5fb7
Fix selected_market reference in xib
stith Jun 5, 2011
08e15f3
Get rid of technicals section for now
stith Jun 5, 2011
d20ce41
Get rid of implicit conversion warnings
stith Jun 5, 2011
7b5a11c
Rework settings window
stith Jun 5, 2011
40bf252
Not using these
stith Jun 5, 2011
688cbc6
Better keychain management
stith Jun 5, 2011
168c5bf
section header for ticker data
Jun 5, 2011
38576e6
Merge branch 'master' of github.com:mrsteveman1/BitTicker-Mac
Jun 5, 2011
045a57c
fix compile error in menu, check for keychainitem with blank user bef…
Jun 5, 2011
5da6c9d
support for showing bitcoin.cz mining stats, added API key field to s…
Jun 8, 2011
5141280
fix paths and remove debug data
Jun 8, 2011
f564ac4
Ticker update flashes red and green depending on direction
martinc Jun 9, 2011
ee33aea
Merge pull request #3 from martinc/master
Jun 9, 2011
0370069
bold text in the menu bar, keep the text slightly green or red if the…
Jun 9, 2011
49e6f3b
add menu options to the main menu (fixes github issue #5, keyboard sh…
Jun 10, 2011
c582b82
remove miner stuff (its still in another tree, going to fork the app)
Jun 10, 2011
b9edebf
made 2 methods return (IBAction) and moved 2 others so theyre all in …
Jun 10, 2011
dfea8c1
move all menu code to a separate controller and make it the delegate …
Jun 10, 2011
31bae42
fix paths in xcode project
Jun 10, 2011
5872cd2
custom view class for each market view, method for adding a menu for …
Jun 11, 2011
2e9b13f
make these properties part of the parent class
Jun 11, 2011
51cc751
automate selection of a market view subclass so it doesnt have to be …
Jun 11, 2011
d53787a
class for tradehill and support for it in the market enum and shared …
Jun 11, 2011
17caa3e
check for blank instead of arbitrary string
Jun 11, 2011
1353187
tradehill view
Jun 11, 2011
58c08e8
support for the main window, which can select a market and load a spe…
Jun 12, 2011
d6bf438
default panel for main window, normal text colors and method for corr…
Jun 12, 2011
2865a94
notification system replaces the multi-level delegate, changes for th…
Jun 13, 2011
998b825
remove notification observers on dealloc
Jun 13, 2011
8061689
make main window panel views obtain and release their own notificatio…
Jun 13, 2011
b783606
fixed a typo in mtgox ticker handling
Jun 28, 2011
253c284
Merge pull request #9 from paeaetech/master
Jun 28, 2011
a40758f
nuclear bomb, dont use this code yet. License change to BSD
Jun 1, 2012
40a00c9
manual merge
Jun 1, 2012
d2e4179
readme
Jun 1, 2012
f4c4085
readme
Jun 1, 2012
b1ae9fd
readme
Jun 1, 2012
4712087
move afnetworking and coreplot binary into the project tree, clean so…
Aug 2, 2012
ed9e131
copy coreplot into bundle during build
Aug 2, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitignore
100644 → 100755
Empty file.
516 changes: 516 additions & 0 deletions AFNetworking/AFHTTPClient.h

Large diffs are not rendered by default.

793 changes: 793 additions & 0 deletions AFNetworking/AFHTTPClient.m

Large diffs are not rendered by default.

154 changes: 154 additions & 0 deletions AFNetworking/AFHTTPRequestOperation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
// AFHTTPRequestOperation.h
//
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#import <Foundation/Foundation.h>
#import "AFURLConnectionOperation.h"

/**
Returns a set of MIME types detected in an HTTP `Accept` or `Content-Type` header.
*/
extern NSSet * AFContentTypesFromHTTPHeader(NSString *string);

extern NSString * AFCreateIncompleteDownloadDirectoryPath(void);

/**
`AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request.
*/
@interface AFHTTPRequestOperation : AFURLConnectionOperation

///----------------------------------------------
/// @name Getting HTTP URL Connection Information
///----------------------------------------------

/**
The last HTTP response received by the operation's connection.
*/
@property (readonly, nonatomic, retain) NSHTTPURLResponse *response;

/**
Set a target file for the response, will stream directly into this destination.
Defaults to nil, which will use a memory stream. Will create a new outputStream on change.

Note: Changing this while the request is not in ready state will be ignored.
*/
@property (nonatomic, copy) NSString *responseFilePath;


/**
Expected total length. This is different than expectedContentLength if the file is resumed.
On regular requests, this is equal to self.response.expectedContentLength unless we resume a request.

Note: this can also be -1 if the file size is not sent (*)
*/
@property (assign, readonly) long long totalContentLength;

/**
Indicator for the file offset on partial/resumed downloads.
This is greater than zero if the file download is resumed.
*/
@property (assign, readonly) long long offsetContentLength;


///----------------------------------------------------------
/// @name Managing And Checking For Acceptable HTTP Responses
///----------------------------------------------------------

/**
A Boolean value that corresponds to whether the status code of the response is within the specified set of acceptable status codes. Returns `YES` if `acceptableStatusCodes` is `nil`.
*/
@property (readonly) BOOL hasAcceptableStatusCode;

/**
A Boolean value that corresponds to whether the MIME type of the response is among the specified set of acceptable content types. Returns `YES` if `acceptableContentTypes` is `nil`.
*/
@property (readonly) BOOL hasAcceptableContentType;

/**
The callback dispatch queue on success. If `NULL` (default), the main queue is used.
*/
@property (nonatomic) dispatch_queue_t successCallbackQueue;

/**
The callback dispatch queue on failure. If `NULL` (default), the main queue is used.
*/
@property (nonatomic) dispatch_queue_t failureCallbackQueue;

///-------------------------------------------------------------
/// @name Managing Accceptable HTTP Status Codes & Content Types
///-------------------------------------------------------------

/**
Returns an `NSIndexSet` object containing the ranges of acceptable HTTP status codes. When non-`nil`, the operation will set the `error` property to an error in `AFErrorDomain`. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

By default, this is the range 200 to 299, inclusive.
*/
+ (NSIndexSet *)acceptableStatusCodes;

/**
Adds status codes to the set of acceptable HTTP status codes returned by `+acceptableStatusCodes` in subsequent calls by this class and its descendents.

@param statusCodes The status codes to be added to the set of acceptable HTTP status codes
*/
+ (void)addAcceptableStatusCodes:(NSIndexSet *)statusCodes;

/**
Returns an `NSSet` object containing the acceptable MIME types. When non-`nil`, the operation will set the `error` property to an error in `AFErrorDomain`. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17

By default, this is `nil`.
*/
+ (NSSet *)acceptableContentTypes;

/**
Adds content types to the set of acceptable MIME types returned by `+acceptableContentTypes` in subsequent calls by this class and its descendents.

@param contentTypes The content types to be added to the set of acceptable MIME types
*/
+ (void)addAcceptableContentTypes:(NSSet *)contentTypes;


///-----------------------------------------------------
/// @name Determining Whether A Request Can Be Processed
///-----------------------------------------------------

/**
A Boolean value determining whether or not the class can process the specified request. For example, `AFJSONRequestOperation` may check to make sure the content type was `application/json` or the URL path extension was `.json`.

@param urlRequest The request that is determined to be supported or not supported for this class.
*/
+ (BOOL)canProcessRequest:(NSURLRequest *)urlRequest;

///-----------------------------------------------------------
/// @name Setting Completion Block Success / Failure Callbacks
///-----------------------------------------------------------

/**
Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed.

@param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request.
@param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occured during the request.

@discussion This method should be overridden in subclasses in order to specify the response object passed into the success block.
*/
- (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure;

@end
Loading