This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: read does not work with basic_ifstream< unsigned char >


Hi Luciano,

You haven't plumbed up the facet, the locale, and/or the codecvt facilities
for your new stream's base type.

Some C++ compilers give you those things for char, and plumb char up to
locale facilities provided by the OS (e.g., the LC_ALL environment
variable).

Most C++ compilers give you those things for char and wchar_t, and, again,
plumb char and wchar_t up to locale facilities provided by the OS.

I don't know of any C++ compilers that provide you those things for unsigned
char, nor do I know of any OS that provides those facilities for unsigned
char.

Take a look at "Standard C++ IOStreams and Locales" by Angelika Langer and
Klaus Kreft, for all the gory details.

You'll be whipping up your own custom std::basic_ifstream<float> and
std::basic_ifstream<MyBigStruct> in no time.

HTH,
--Eljay


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]