• 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: Cocoa version of the fstream lib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa version of the fstream lib?


  • Subject: Re: Cocoa version of the fstream lib?
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Fri, 6 Feb 2004 18:05:42 +0100

At 7:10 Uhr -0600 06.02.2004, Jeremyah Payne wrote:
How would i do something like

ifstream fin;

fin.open("somefile.txt");

fin>>data;

fin.close();

You'd use NSInputStream. It requires 10.3, though. If you need to support something earlier than that, either load the entire file into an NSData, then mess with its -bytes, or use an NSFileHandle to get bits and pieces out.

NSScanner may also be helpful if you're reading text data and want scanf()-like behaviour.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Cocoa version of the fstream lib? (From: Jeremyah Payne <email@hidden>)

  • Prev by Date: Setting the Proxy Icon of the window to Application Icon
  • Next by Date: Re: Entering UniCode
  • Previous by thread: Re: Cocoa version of the fstream lib?
  • Next by thread: [Q] NSScanner -> \t\t how to fix??
  • Index(es):
    • Date
    • Thread