Can't write ustring to std::cout [Was: Re: string problems]
- From: Philipp Klaus Krause <pkk spth de>
- To: Sebastian <sebastian_rose gmx de>
- Cc: "\[gtkmm-list\]" <gtkmm-list gnome org>
- Subject: Can't write ustring to std::cout [Was: Re: string problems]
- Date: Fri, 05 Oct 2007 15:49:07 +0200
Sebastian schrieb:
> If you don't mind using Glibmm for reading the file:
>
> Glib::ustring s;
> Glib::RefPtr<Glib::IOChannel> ioc =
> Glib::IOChannel::create_from_file(filename, "r");
> ioc->read_to_end(s);
I'de prefer not to use IOChannel, since it seems more elegant to use
generic istream and ostream (so I can use cout in place of an output
file if I want to).
I just did another test (line is a Glib::ustring):
std::string linetmp;
std::getline(source, linetmp);
line = linetmp;
linetmp = line;
std::cout << linetmp << "\n";
works,
std::string linetmp;
std::getline(source, linetmp);
line = linetmp;
linetmp = line;
std::cout << line << "\n";
still doesn't.
Philipp
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]