A Library for using operator << to format to AnsiString and TStrings.
Copyright (c) 2003 Early Ehlinger
The VCL has two common string types that would truly benefit from the ability to use C++ <iostream>-style formatting: AnsiString and TStrings. This library provides two std::ostream derivatives; res_bcb::AnsiString_stream and res_bcb::TStrings_stream.
#include <ResBCB/AnsiString_stream.h>
/*.......*/
{
res_bcb::AnsiString_stream message;
message
<< "Hello There. Here's a number:"
<< 32
<< std::endl
<< " and here's another:"
<< 32
<< std::endl;
ShowMessage( message.str() );
} |
#include <ResBCB/TStrings_stream.h>
/*.......*/
{
res_bcb::TStrings_stream memo
( Memo1->Lines
, true );
/* The true in memo's constructor tells
TStrings_stream to do
Application->ProcessMessages() whenever
the stream flushes to the underlying
TStrings*. */
memo
<< "Hello There. Here's a number:"
<< 32
<< std::endl
<< " and here's another:"
<< 32
<< std::endl;
} |