Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > getline - refresher

Reply
Thread Tools

getline - refresher

 
 
brekehan8@gmail.com
Guest
Posts: n/a
 
      04-09-2009
Been a long long time since I did basic file parsing. See what working
with your employers libraries does to you?!

I am using fstream::getline. I cannot remember, if I attempt to read a
line that is longer than my provided buffer size, will fstream::fail()
return true, and therefore fstream::good() return false?

Is there any other way to parse a line of a file at a time directly
into a string or stringstream, since it ends up there anyway in my
code?

 
Reply With Quote
 
 
 
 
brekehan8@gmail.com
Guest
Posts: n/a
 
      04-09-2009

Or heck, I would even be happy if I could read the entire file
directly into a stringstream, because I am going to use the extractor
and string's find methods now that I think about it.
 
Reply With Quote
 
 
 
 
Jerry Coffin
Guest
Posts: n/a
 
      04-09-2009
In article <9a9179e2-2e3e-4e11-97af-e5cacf7c7e80
@k2g2000yql.googlegroups.com>, http://www.velocityreviews.com/forums/(E-Mail Removed) says...
>
> Or heck, I would even be happy if I could read the entire file
> directly into a stringstream, because I am going to use the extractor
> and string's find methods now that I think about it.


For that, you can use something like:

std::stringstream buffer;

buffer << input_stream.rdbuf();

--
Later,
Jerry.

The universe is a figment of its own imagination.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need refresher course to figure out what I'm doing wrong richard HTML 6 09-18-2006 04:56 PM
Tab refresher plug-in? cmerch19602003 Firefox 1 08-12-2006 12:59 AM
IPSec tutorial/refresher Imhotep Computer Security 2 09-10-2005 02:39 AM
C++ refresher projects after a 3 yr gap capes C++ 0 09-09-2005 07:22 PM
regsvr32 refresher needed Richard Computer Support 1 01-03-2005 10:14 AM



Advertisments