Circus 0.0.1-alpha
C++ Serialization Framework
Loading...
Searching...
No Matches
circus::filesystem::reader__ Class Reference

Utility class to read contents from input streams into a string. More...

#include <reader.hpp>

Public Member Functions

 reader__ ()
 Default constructor initializes an empty content buffer.
std::string operator() (std::istream &is)
 Reads entire contents of the provided input stream into internal buffer.
std::size_t size () const noexcept
 Get the size in bytes of the stored content.
const std::string & get_file_contents () const noexcept
 Provides read-only access to the stored file contents.

Detailed Description

Utility class to read contents from input streams into a string.

Provides an interface to load the entire contents of an std::istream into an internal string buffer for later access.

Member Function Documentation

◆ get_file_contents()

const std::string & circus::filesystem::reader__::get_file_contents ( ) const
inlinenodiscardnoexcept

Provides read-only access to the stored file contents.

Returns
Const reference to the internal content string.

◆ operator()()

std::string circus::filesystem::reader__::operator() ( std::istream & is)
inline

Reads entire contents of the provided input stream into internal buffer.

Parameters
isInput stream to read from.
Returns
A reference to the internal string containing the full content.

◆ size()

std::size_t circus::filesystem::reader__::size ( ) const
inlinenodiscardnoexcept

Get the size in bytes of the stored content.

Returns
Size of the content string.

The documentation for this class was generated from the following file: