Can't write ustring to std::cout [Was: Re: string problems]



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]