CONZEPT 16 C++ API
C16::Text::StreamInput Class Reference

Input stream for reading texts. More...

#include "C16/Text.hpp"

Inheritance diagram for C16::Text::StreamInput:
C16::Text::Stream

Detailed Description

Input stream for reading texts.

Examples

Usage

#include "C16/Library.hpp"
#include <string> // std::string, std::getline
using namespace C16;
void text_stream_input_usage(const Text& text)
{
Text::StreamInput text_stream_input(text);
std::string line;
// Iterates the lines of the text.
while (std::getline(text_stream_input, line))
{
...
}
}
See also
content

Public Member Functions

 StreamInput ()
 Constructs an input stream. More...
 
 StreamInput (const Text &text)
 Constructs an input stream and associates a text buffer with it. More...
 
void associate (const Text &text)
 Associates a text buffer with the input stream. More...
 
- Public Member Functions inherited from C16::Text::Stream
bool associated () const
 Gets if there is text buffer associated with the stream. More...
 
const Texttext () const
 Gets the text buffer associated with the stream, if associated. More...
 
void dissociate ()
 Dissociates an associated text buffer from the stream. More...
 
LineBreak line_break () const
 Gets the line break of the stream. More...
 
void line_break_set (LineBreak line_break)
 Sets the line break of the stream. More...
 

Constructor & Destructor Documentation

◆ StreamInput() [1/2]

C16::Text::StreamInput::StreamInput ( )

Constructs an input stream.

◆ StreamInput() [2/2]

C16::Text::StreamInput::StreamInput ( const Text text)
explicit

Constructs an input stream and associates a text buffer with it.

Parameters
textText buffer to associate

Member Function Documentation

◆ associate()

void C16::Text::StreamInput::associate ( const Text text)

Associates a text buffer with the input stream.

Parameters
textText buffer
Note
Has no effect if there already is a text buffer associated with the input stream.
C16::Text::Stream::text
const Text * text() const
Gets the text buffer associated with the stream, if associated.
C16::Text
Text buffer to operate on texts of a database.
Definition: Text.hpp:64
Library.hpp
CONZEPT 16 C++ API.
C16::Text::StreamInput
Input stream for reading texts.
Definition: Text.hpp:871
C16
Namespace.
Definition: Array.hpp:6