about
12/06/2022
IOStreams Repo
IOStreams code

IOStreams  Repository

Illustrates most of the capabilites of the IO Stream Libraries

Quick Status Code functions correctly no known defects Demonstration code yes Documentation yes Test cases none planned Static library none planned Build requires C++17 option Planned design changes None
Fig 1. IOStreams Classes

1.0 Concept

The std::iostream libraries provide stream interfaces for reading and writing to the console, files, and stringstreams. The iostream class hierarchy is rooted at std::ios, a class for managing formats, error states, and stream buffers.
std::streambuf connects a C++ program with the console, std::filebuf connects to files, and std::stringbuf connects to in-memory strings through a stream interface.
std::istream, std::ifstream, and std::istringstream provide interfaces for programs to use ios and read from filebufs in a simple way. Similarly, std::ostream, std::ofstream, and std::ostringstream provide an interface to use ios and write to filebufs.
These classes do not provide any virtual functions, but if you need to modify a stream's behaviour you can do that by overriding virtual functions in the streambuf classes.

2.0 Contents

This repository contains demonstration codes that illustrate:
  • Formats
    Formatting stream outputs.
  • Fileio
    Typical file input-output operations.
  • Filebuf
    Programming filebufs for the same kind of input-output operations.
  • Stringio
    Typical usage for stringstreams.
  • ReadWrite
    Setting up a stream for both read and write operations.

3.0 Build

IOStreams code was built with Visual Studio Community Edition - 2019 and tested on Windows 10.

4.0 Resources

iostreams.pdf
Quick description of the std::iostream hierarchy.
iostreamsRef.pdf
Complete description of the interfaces for ios and each of the iostream, and streambuf classes
  Next Prev Pages Sections About Keys