Apache C++ Standard Library User's Guide
Chapter 38: Creating New Stream Classes by Derivation
38.1 Deriving a New Stream Type
38.2 Choosing a Base Class
38.3 Construction and Initialization
38.3.1 Derivation from File Stream or String Stream Classes std::{i,o}fstream or std::{i,o}stringstream
38.3.2 Derivation from the Stream Classes std::basic_{i,o}stream
38.4 The Example
38.4.1 The Derived Stream Template
38.4.2 The Date Inserter
38.4.3 The Manipulator
38.4.4 A Remark on Performance
38.5 Using iword/pword for RTTI in Derived Streams