Tools.h++ Class Reference

Table Of Contents
Persistence
None
Short Example
#include <rw/auditbuf.h>
#include <rw/bstream.h>
#include <rw/pstream.h>
#include <iostream.h>
int main() {
RWCollectable ct;
fillCollectable(); // make a collection, somehow
RWAuditStreamBuffer bcounter, pcounter;
RWbostream bcount(&bcounter); //ctor takes streambuf pointer
RWpostream pcount(&pcounter);
//_
bcount << ct;
pcount << ct;
cout << "We just counted " << bcounter
<< " bytes from an RWbostream." << endl;
cout << "We just counted " << pcounter
<< " bytes from an RWpostream." << endl;
return 0;
}
Related Classes
RWAuditStreamBuffer may be used as the streambuf for any stream, including those derived
from RWvostream or RWvistream, strstream, ifstream, ofstream, etc.
Global Typedef
typedef void (*RWauditFunction)(unsigned char, void*);
If you wish to do more than count each character handled by the buffer, you may provide
an RWauditFunction to the constructor. The first parameter to this function is a byte
provided by the stream. The second parameter is the address of the conter to be
manipulated by RWAuditFunction.