ifstream and wifstream - combined

B

Ben Hetland

Is there a simple and elegant _standard_ solution to the following, or
does somebody have pointer to a freely available implementation that
provides the following functionality?

I want to read text files.

I want to be flexible regarding the precise format used in the file, so
either plain ASCII (or iso-8859-1), Unicode (e.g. 16-bit wide), or some
UTF encoding (say UTF-8) should be equally acceptable.

Different styles of line-endings should also be accepted, e.g. \n\r vs \n.

I want the details of the actual encoding to be transparent to my
program, which can then only concern itself about interpreting the
content of the file. For instance, everything could be read as wchar_t
inside "my sources".

Preferrably should work with buffered reading.

Must work seemlessly with all std routines and other relevant library
functions (e.g. the std::getline template).


-+-Ben-+-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top