CatNiP docutest
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
A basic URL fetch class that reads the given URL into an NSData object and passes it on to it's delegate once the process has finished. More...
#import <MediaWikiQuery.h>
Public Member Functions | |
(void) | - addProgressListener: |
Adds a progress listener object to this object's listeners. | |
(NSString *) | - buildQueryURL |
Builds the query URL, intended to be easily re-implemented in sublcasses. | |
(void) | - connection:didFailWithError: |
NSURLConnection delegate method. | |
(void) | - connection:didReceiveData: |
NSURLConnection delegate method. | |
(void) | - connection:didReceiveResponse: |
NSURLConnection delegate method. | |
(void) | - connectionDidFinishLoading: |
NSURLConnection delegate method. | |
(void) | - dealloc [implementation] |
(id) | - init [implementation] |
Initializes the object. | |
(id) | - initWithDelegate: |
Initialize a new MediaWikiQuery object with the specified delegate. | |
(id) | - initWithDelegate:mediaWikiURL: |
Initialize a new MediaWikiQuery object with the specified delegate and MediaWiki URL (as a string) | |
(void) | - removeProgressListener: |
Removes a progress listener object from this object's listeners. | |
(BOOL) | - startQuery |
Launches the query process. | |
Protected Attributes | |
NSURLConnection * | mediaWikiConnection |
NSURLRequest * | mediaWikiRequest |
NSMutableSet * | progressListeners |
id< MediaWikiQueryDelegate > | queryDelegate |
NSMutableData * | receivedData |
BOOL | working |
Properties | |
NSInteger | currentBytes |
Manual accessor for currentBytes. | |
NSInteger | expectedSize |
Manual accessor for expectedSize. | |
NSString * | mediaWikiURLString |
The base URL for this MediaWiki query. |
A basic URL fetch class that reads the given URL into an NSData object and passes it on to it's delegate once the process has finished.
Created by Antti V J Niemela, tkol on 5/24/11. Copyright 2011 University of Helsinki. All rights reserved.
- (void) addProgressListener: | (id <MediaWikiProgressListener>) | listener |
Adds a progress listener object to this object's listeners.
Progress Listeners receive periodic updates on the progress of the data transfer taking place. Multiple listeners are supported.
listener | A MediaWikiProgressListener that should receive updates. |
- (NSString *) buildQueryURL |
Builds the query URL, intended to be easily re-implemented in sublcasses.
Builds the query URL.
The URL is based on the mediaWikiURString property. Subclasses of MediaWikiQuery will likely want to override this method.
Reimplemented in MediaWikiCategoryQuery, and MediaWikiPageQuery.
- (void) connection: | (NSURLConnection *) | connection | |
didFailWithError: | (NSError *) | error | |
NSURLConnection delegate method.
NSURLConnectionDelegate implementation, reports the error with NSLog.
- (void) connection: | (NSURLConnection *) | connection | |
didReceiveData: | (NSData *) | data | |
NSURLConnection delegate method.
NSURLConnectionDelegate implementation, reads the data into an internal variable.
- (void) connection: | (NSURLConnection *) | connection | |
didReceiveResponse: | (NSURLResponse *) | response | |
NSURLConnection delegate method.
NSURLConnectionDelegate implementation, resets the internal data buffer (only the data from the last response is stuff we're interested in).
- (void) connectionDidFinishLoading: | (NSURLConnection *) | connection |
NSURLConnection delegate method.
NSURLConnectionDelegate implementation, passes the received data to the delegate.
- (void) dealloc | [implementation] |
- (id) init | [implementation] |
Initializes the object.
Reimplemented in MediaWikiCategoryQuery, and MediaWikiPageQuery.
- (id) initWithDelegate: | (id <MediaWikiQueryDelegate>) | mediaWikiQueryDelegate |
Initialize a new MediaWikiQuery object with the specified delegate.
Initializes the object with the specified delegate.
mediaWikiQueryDelegate | The delegate object that will receive the data read from the URL |
- (id) initWithDelegate: | (id <MediaWikiQueryDelegate>) | mediaWikiQueryDelegate | |
mediaWikiURL: | (NSString*) | mwURLString | |
Initialize a new MediaWikiQuery object with the specified delegate and MediaWiki URL (as a string)
Initializes the object with the specified delegate and MediaWiki URL.
mediaWikiQueryDelegate | The delegate object that will receive the data read from the URL |
mwURLString | The URL to read from. |
- (void) removeProgressListener: | (id <MediaWikiProgressListener>) | listener |
Removes a progress listener object from this object's listeners.
listener | The listener to remove from this object's listener set. |
- (BOOL) startQuery |
Launches the query process.
Starts the MediaWiki query.
Starts the HTTP query represented by the URL received using [self buildQueryURL] using an internal NSURLConnection object. This object functions as the delegate for the NSURLConnection, and passes the read data to it's delegate once the connection finishes loading.
- (NSURLConnection*) mediaWikiConnection [protected] |
- (NSURLRequest*) mediaWikiRequest [protected] |
- (NSMutableSet*) progressListeners [protected] |
- (id<MediaWikiQueryDelegate>) queryDelegate [protected] |
- (NSMutableData*) receivedData [protected] |
- (BOOL) working [protected] |
- (NSInteger) currentBytes [read, assign] |
Manual accessor for currentBytes.
- (NSInteger) expectedSize [read, assign] |
Manual accessor for expectedSize.
Only available once a NSURLResponse has been received from the target host. Returns NSIntegerMin if a response has not yet been received, and -1 when a response has been received but it did not contain information on the size of the response.
- (NSString *) mediaWikiURLString [read, write, copy] |
The base URL for this MediaWiki query.