From afa343ed0849c3ec03f48ce4d5113df88d969621 Mon Sep 17 00:00:00 2001 From: "Gun.io Whitespace Robot" Date: Fri, 28 Oct 2011 03:55:35 -0400 Subject: [PATCH] Remove whitespace [Gun.io WhitespaceBot] --- .gitignore | 20 +++ ofxiPhoneFile/ofxiPhoneFile.h | 30 ++-- ofxiPhoneFile/ofxiPhoneFile.mm | 144 +++++++++--------- .../ofxiPhoneAnayltics.mm | 2 +- .../ofxiPhoneFlurryAnalytics.h | 6 +- ofxiPhoneGameKit/ofxiPhoneGameKit.h | 20 +-- ofxiPhoneGameKit/ofxiPhoneGameKit.mm | 48 +++--- ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.h | 24 +-- ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.mm | 2 +- .../ofxiPhoneRawDataPOSTer.h | 14 +- .../ofxiPhoneRawDataPOSTer.mm | 28 ++-- 11 files changed, 179 insertions(+), 159 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac8f968 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc + +# Logs and databases # +###################### +*.log + +# OS generated files # +###################### +.DS_Store* +ehthumbs.db +Icon? +Thumbs.db diff --git a/ofxiPhoneFile/ofxiPhoneFile.h b/ofxiPhoneFile/ofxiPhoneFile.h index 9c7965f..be474fb 100644 --- a/ofxiPhoneFile/ofxiPhoneFile.h +++ b/ofxiPhoneFile/ofxiPhoneFile.h @@ -19,43 +19,43 @@ class ofxiPhoneFile { public: - + ofxiPhoneFile(); - + bool open(string fileName, int readWrite); bool openFromData(string fileName, int readWrite); bool openFromURL(string url); bool open(string fileName, int fileLen, int readWrite); // if you are trying to read in a giagantic file all at once, you may need to use this function and increase fileLen - - void close(); - + + void close(); + char * read(); - char * readNextLine(); + char * readNextLine(); char * readLine(int lineNum); - + bool write(string data); - + bool writeLine(string data); bool commitLines(); // if you have been using writeLine, you must commit the lines to the file using this function. - + NSString *filePath; - + NSString * file; NSArray *lines; - + char * fileData; char lineData[2000]; string writtenLines; int maxFileLen; int numLines; - + bool verbose; - + int IO; - + private: - + int lastLineRead; }; diff --git a/ofxiPhoneFile/ofxiPhoneFile.mm b/ofxiPhoneFile/ofxiPhoneFile.mm index 30c3790..14223ca 100644 --- a/ofxiPhoneFile/ofxiPhoneFile.mm +++ b/ofxiPhoneFile/ofxiPhoneFile.mm @@ -23,32 +23,32 @@ NSArray *foundPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //find a path to the documents directory NSString *documents = [foundPaths objectAtIndex:0]; //store the path if (documents == nil) - { + { printf("Error: couldn't fine documents folder"); [foundPaths release]; return false; } - + //NSString * fn = [[NSString alloc] initWithCString: fileName.c_str()]; filePath = [[NSString alloc] initWithCString: ofToDataPath(fileName).c_str()]; //[documents stringByAppendingPathComponent:fn]; //append the file name to the end of the path to make the path to the file! //[fn release]; - + maxFileLen = 5000; - + lastLineRead=0; - + fileData = new char[maxFileLen]; - - + + if(readWrite == OFX_IPHONE_FILE_READ) { file = [NSString stringWithContentsOfFile: filePath]; - - + + //[file UTF8String: fileString]; //[file cStringUsingEncoding:NSASCIIStringEncoding]; - + if(file==nil) { cout<<"Error: "<=numLines) { return ""; @@ -342,10 +342,10 @@ NSString * temp = [lines objectAtIndex:lastLineRead]; [temp getCString:lineData maxLength:maxFileLen-1 encoding:NSASCIIStringEncoding]; - + if(verbose) cout<recievedData([data bytes], [data length]); // if we've figured out the server, pass along the data to the app - else + else {// time to figure out who is acting as the server. - + float theirNumber; memcpy(&theirNumber,[data bytes],[data length]); if(myCoinFlipNumber > theirNumber) @@ -195,7 +195,7 @@ - (void) receiveData:(NSData *)data fromPeer:(NSString *)peer inSession: (GKSess coinFlipComplete = true; gameKit->setReady(true); } - else // equal picks, flip again. + else // equal picks, flip again. { myCoinFlipNumber = ofRandomuf(); // generate a number between 0 and 1 to decide who is acting as the server. [self sendData:[NSData dataWithBytes:(void *)&myCoinFlipNumber length:sizeof(float)] ]; @@ -208,8 +208,8 @@ - (void) receiveData:(NSData *)data fromPeer:(NSString *)peer inSession: (GKSess //---------------------------------------------------------------- - (GKSession *)peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type -{ - +{ + GKSession* session = [[GKSession alloc] initWithSessionID:sessionName displayName:nil sessionMode:GKSessionModePeer]; [session autorelease]; return session; @@ -218,7 +218,7 @@ - (GKSession *)peerPickerController:(GKPeerPickerController *)picker sessionForC //---------------------------------------------------------------- - (void)session:(GKSession *)session peer:(NSString *)peerID didChangeState:(GKPeerConnectionState)state; -{ +{ switch (state) { case GKPeerStateConnected: @@ -226,9 +226,9 @@ - (void)session:(GKSession *)session peer:(NSString *)peerID didChangeState:(GKP [mPeers addObject:peerID]; gameKit->setConnected(true); cout<<"connected!"<setConnected(false); cout<<"disconnected!"<setReady(false); @@ -248,14 +248,14 @@ - (void)session:(GKSession *)session peer:(NSString *)peerID didChangeState:(GKP - (void)disconnect { - if(mSession != nil) + if(mSession != nil) { - [mSession disconnectFromAllPeers]; - mSession.available = NO; - [mSession setDataReceiveHandler: nil withContext: NULL]; - mSession.delegate = nil; + [mSession disconnectFromAllPeers]; + mSession.available = NO; + [mSession setDataReceiveHandler: nil withContext: NULL]; + mSession.delegate = nil; } - + gameKit->setConnected(false); cout<<"disconnected!"<setPeerPickerOpen(false); } @@ -297,7 +297,7 @@ - (void) showPeerPicker GKPeerPickerController *mPicker; mPicker=[[GKPeerPickerController alloc] init]; mPicker.delegate=self; - + [mPicker show]; gameKit->setPeerPickerOpen(true); } diff --git a/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.h b/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.h index 832ec9d..2f9f4e2 100644 --- a/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.h +++ b/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.h @@ -21,7 +21,7 @@ class cppOFOpenFeintDelegate }; @interface ofxiPhoneOpenFeintDelegate : NSObject -{ +{ cppOFOpenFeintDelegate * cppDel; } - (void) dashboardWillAppear; @@ -36,30 +36,30 @@ class cppOFOpenFeintDelegate class ofxiPhoneOpenFeint : public cppOFOpenFeintDelegate { - + public: - + ofxiPhoneOpenFeint(); ~ofxiPhoneOpenFeint(); - + void approveOpenFeint(); void open(); void setOpenBool(bool o); - + void connect(); - + void setActive(bool p); - + void submitHighscore(int score, int _id); void getAchievement(int _id); - + bool isOpen; - + protected: - + ofxiPhoneOpenFeintDelegate * openFeint; - + NSString * stringToNSString(string s); - + bool connected; }; \ No newline at end of file diff --git a/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.mm b/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.mm index 46a82ed..3ab0dd0 100644 --- a/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.mm +++ b/ofxiPhoneOpenFeint/ofxiPhoneOpenFeint.mm @@ -11,7 +11,7 @@ ofxiPhoneOpenFeint::ofxiPhoneOpenFeint() { - isOpen=false; + isOpen=false; connected = false; openFeint = [[NSObject init] alloc]; } diff --git a/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.h b/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.h index cb381d3..7729f5b 100644 --- a/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.h +++ b/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.h @@ -31,23 +31,23 @@ class ofxiPhoneRawDataPOSTer; class ofxiPhoneRawDataPOSTer { public: - + ofxiPhoneRawDataPOSTer(); - + void postData(string url, string data); - + void finished(); - + bool failed; - + bool posting; string response; - + NSMutableURLRequest *request; NSData *aData; NSData *urlData; NSURLConnection * uploadPageURLConnection; NSMutableData * receivedData; - + UrlDelegate * urlDelegate; }; \ No newline at end of file diff --git a/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.mm b/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.mm index 14297fe..4aa3215 100644 --- a/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.mm +++ b/ofxiPhoneRawDataPOSTer/ofxiPhoneRawDataPOSTer.mm @@ -13,7 +13,7 @@ { posting = false; failed = false; - + urlDelegate = [[UrlDelegate alloc] initWithDelegate:this]; } @@ -23,23 +23,23 @@ { failed = false; posting = true; - NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[[[[NSString alloc] initWithCString: url.c_str()] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding] autorelease]]]; + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[[[[NSString alloc] initWithCString: url.c_str()] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding] autorelease]]]; NSString *httpBody = [[[[NSString alloc] initWithCString: data.c_str()] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding] autorelease]; - + aData = [httpBody dataUsingEncoding:NSUTF8StringEncoding]; //NSUTF8StringEncoding [request setHTTPBody:aData]; [request setHTTPMethod:@"POST"]; uploadPageURLConnection = [[NSURLConnection alloc] initWithRequest:request delegate:urlDelegate startImmediately:YES]; - + receivedData=[[NSMutableData data] retain]; [receivedData setLength:0]; - /*NSString *data=[[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding] autorelease]; - + /*NSString *data=[[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding] autorelease]; + char response[ [data length]+1 ]; [data getCString:response]; - - + + return string(response);*/ } } @@ -52,7 +52,7 @@ [uploadPageURLConnection release]; char responseChars[[receivedData length]]; memcpy(&responseChars,[receivedData mutableBytes],[receivedData length]); - + response = string(responseChars); response = response.substr(1,response.length()-1); [receivedData release]; @@ -85,15 +85,15 @@ - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLRespon { /* NSString *data = [response query]; - + data = [data stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - - + + char cResponse[ [data length]+1 ]; [data getCString:cResponse]; - + cppDelegate->response = cResponse; - + NSLog(response);*/ }