Subject: Re: [htdig3-dev] Patch for Ht://Dig
From: loic@ceic.com
Date: Wed Dec 15 1999 - 01:04:10 PST
> > > > int
> > > > String::readLine(FILE *in)
> > > > {
> > > > Length = 0;
> > > > allocate_fix_space(2048);
> > > >
> > > > while (fgets(Data + Length, Allocated - Length, in))
> > > > {
> > > > Length += strlen(Data + Length);
> > > > if (Length == 0)
> > > > continue;
> > > > if (Data[Length - 1] == '\n')
> > > > {
> > > > //
> > > > // A full line has been read. Return it.
> > > > //
> > > > chop('\n');
> > > > return 1;
> > >
You might want to reuse the coding logic found in Configuration.cc
(Read method) or WordList.cc (operator >>). Both use iostreams however.
It's simpler to do it with FILE* because you don't have to mess with
the terminating character.
Cheers,
-- Loic Dachary24 av Secretan 75019 Paris Tel: 33 1 42 45 09 16 e-mail: loic@dachary.org URL: http://www.senga.org/
------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to htdig3-dev-unsubscribe@htdig.org You will receive a message to confirm this.
This archive was generated by hypermail 2b28 : Wed Dec 15 1999 - 01:20:13 PST