Overview
Features
Download
Documentation
Community
Add-Ons & Services

seekpos always returns -1

A general discussion forum.

seekpos always returns -1

Postby petervn » 13 Oct 2009, 02:44

I am evaluating the StreamConverter class for converting UTF-8 encoded file into UTF-16. The conversion itself works fine, but I ran into problem trying to get a current stream position. The position returned with tellg() turned out to be invalid (-1). tellg() invokes streambuf::pubseekoff() which calls a virtual function streambuf::seekoff. The StreamConverter uses default implementation of seekof which always returns an invalid position. Is this a implementation bug in the StreamConverter ?
petervn
 
Posts: 12
Joined: 06 Oct 2009, 21:39

Re: seekpos always returns -1

Postby petervn » 15 Oct 2009, 20:29

Anyone?
petervn
 
Posts: 12
Joined: 06 Oct 2009, 21:39

Re: seekpos always returns -1

Postby guenter » 15 Oct 2009, 20:41

In POCO, only File*Stream classes support seek operations. For all other streams seek operations will fail as they are not implemented. In the case of StreamConverter, you can try a seek operation on the underlying stream (the one you pass in the constructor).
guenter
 
Posts: 1129
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron