According to Geoff Hutchison:
> At 3:05 PM +0300 12/8/99, Alexis Mikhailov wrote:
> >I haven't seen single call to getline() in 3.1.x version. Is it in
> >3.2?
> 
> See, for example, htdig/ExternalParser.cc

Oops, bad example.  ExternalParser uses fgets() to read from a FILE
obtained by popen(), which is standard C library stuff.  Configuration.cc
and cgi.cc use C++ ifstream objects, and the getline() method.

I guess either would do for reading a list of URLs from the standard
input, though, depending on whether you want to use stdin or cin.
Both fgets() and ifstream::getline() will read into a char array, to
a maximum length you specify, and give you the line with the newline
character at the end.  (I suspect that internally, getline() may just
call fgets().)

The ExternalParser::readLine() method has the advantage that it makes
sure you don't end up with a truncated line, if an input line is bigger
than your buffer.  So, maybe it's not such a bad example after all.

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] 
You will receive a message to confirm this. 

Reply via email to