J
Jim Langston
I have a computer game that has no console. If I want to output something I
push a string to the back of a std::vector<std::string> and that gets output
and maintained.
All is well and good, but what I would like to do is to be able to use
ostream's power for this output. I could create my own ostream and check it
every cycle or something, but then I would have to pass this ostream or make
it global.
What I would like to do is have something like:
std::cout << "Player " << ThisPlayer.Name() << " logged in at: " << time()
<< "\n";
and have that get redirected, somehow, to my vector.
If no one has an easy way to do this I'll have to go with the global ostream
approach and pull everything out of it every cycle.
push a string to the back of a std::vector<std::string> and that gets output
and maintained.
All is well and good, but what I would like to do is to be able to use
ostream's power for this output. I could create my own ostream and check it
every cycle or something, but then I would have to pass this ostream or make
it global.
What I would like to do is have something like:
std::cout << "Player " << ThisPlayer.Name() << " logged in at: " << time()
<< "\n";
and have that get redirected, somehow, to my vector.
If no one has an easy way to do this I'll have to go with the global ostream
approach and pull everything out of it every cycle.