[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Ungetch: Unicode compliant?
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2001-06-07 7:23:28
[Download RAW message or body]

> 1) what do you want to do ? ungetch apparently only decrements the current
> read pointer, so that a next readLine() will reread the same text. doing
> this is usually a very bad and errorprone coding-style.
> 
> 2) QString::length _might_ be different from the length of the string in the
> file because of the applied conversions. You're lost at this point, because
> you can hardly know how many bytes you have to "roll-back".

My goal is to put a line of text back to a text file (or back to a buffer that
get its data from a text file, but I don't know if such class exists). I'm parsing 
a file on a line basis, which makes the parsing code quite elegant. The problem 
is that I only know I have to stop parsing (temporarily) when I get a line
starting with a specific character. However this line has to be read again later.
That's why I used ungetch.

Michael.

-- 
------------------------------------------------------------------
Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul@imec.be	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM
------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic