Demystifying C++ I/O
Marc Gregoire · 2021
Streams provide a flexible and object-oriented way to perform input and output. C++ provides a more refined method of input and output through a mechanism known as streams. Streams are a flexible and object-oriented approach to I/O. This chapter covers the most commonly used I/O features. It discusses the filesystem support library provided by the C++ Standard Library. This library allows the readers to work with paths, directories, and files, and it nicely complements the mechanisms provided for I/O by the streams. The Standard Library comes with a number of built-in stream manipulators, but if need be, custom manipulators can be written. The C++ Standard Library includes a filesystem support library, defined in and living in the std::filesystem namespace. The two most important parts of the library—paths and directory entries—are introduced.