• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Objective-C BufferedReader
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C BufferedReader


  • Subject: Re: Objective-C BufferedReader
  • From: Marten van Gelderen <email@hidden>
  • Date: Sun, 13 Feb 2005 16:00:53 +0100

Hamish,

An alternative way might be the following:

- (void)fileScannerAtPath:(NSString *)filePath
{
if ([[NSFileManager defaultManager] isReadableFileAtPath: filePath]) {
NSString *fileContents = [NSString stringWithContentsOfFile: filePath];
unsigned int fileLength = [fileContents length];
NSRange lineRange = NSMakeRange(0, 0);
NSScanner *lineScanner;


while (lineRange.location < fileLength) {
lineRange = [fileContents lineRangeForRange: lineRange];
lineScanner = [NSScanner scannerWithString: [fileContents substringWithRange: lineRange]];


/* scan something in the lineScanner and do something with it ... */

	    	lineRange = NSMakeRange(NSMaxRange(lineRange), 0);
		}
    }
}

On 12 Feb 2005, at 23:39, Hamish Allan wrote:

Hi,

I have as yet been unable to find anything written in Objective-C that provides the functionality of Java's java.io.BufferedReader.

1) Does such a library object exist, and if so, where?


-- Groeten, Marten


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: help with NSImage
  • Next by Date: Synchronising views within an enclosing scroll view
  • Previous by thread: Re: Objective-C BufferedReader
  • Next by thread: Background threading in an NSView?
  • Index(es):
    • Date
    • Thread