ifstream and wifstream - combined

Discussion in 'C++' started by Ben Hetland, Sep 20, 2005.

  1. Ben Hetland

    Ben Hetland Guest

    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-+-
     
    Ben Hetland, Sep 20, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    407
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Jul 18, 2005
  2. anubis
    Replies:
    2
    Views:
    1,302
    anubis
    Mar 21, 2006
  3. toton

    wstring & wifstream

    toton, Sep 29, 2006, in forum: C++
    Replies:
    9
    Views:
    2,557
    =?iso-8859-1?q?Kirit_S=E6lensminde?=
    Oct 2, 2006
  4. koara

    wifstream & locale

    koara, Feb 5, 2008, in forum: C++
    Replies:
    2
    Views:
    785
    koara
    Feb 6, 2008
  5. Ioannis Vranos

    wifstream/wofstream names

    Ioannis Vranos, Sep 30, 2008, in forum: C++
    Replies:
    1
    Views:
    716
Loading...

Share This Page