xtd 0.2.0
Loading...
Searching...
No Matches
text_reader.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../core_export.hpp"
6#include "../object.hpp"
7#include "../string.hpp"
8#include <cstdio>
9#include <istream>
10#include <string>
11
13namespace xtd {
15 namespace io {
17 class null_text_reader;
18 class synchronized_text_reader;
20
37 public:
39
46 static null_text_reader& null() noexcept;
48
50
53 virtual void close();
54
57 virtual int32 peek() const;
58
61 virtual int32 read();
62
68 virtual size_t read(std::vector<char>& buffer, size_t index, size_t count);
69
75 virtual size_t read_block(std::vector<char>& buffer, size_t index, size_t count);
76
79 virtual xtd::string read_line();
80
84 virtual xtd::string read_to_end();
86
88
93 static synchronized_text_reader synchronised(text_reader& reader) noexcept;
95
96 protected:
98
101 text_reader() = default;
103 };
104
117 public:
119
121 int32 read() override;
123 };
124
137 public:
139
141 int32 read() override;
143
144 private:
145 friend class text_reader;
147 synchronized_text_reader() = delete;
148 xtd::io::text_reader& reader_;
149 };
150 }
151}
Represents a null text reader.
Definition text_reader.hpp:116
int32 read() override
Reads the next character from the input stream and advances the character position by one character.
Represents a synchronized text reader.
Definition text_reader.hpp:136
int32 read() override
Reads the next character from the input stream and advances the character position by one character.
Represents a reader that can read a sequential series of characters.
Definition text_reader.hpp:36
static null_text_reader & null() noexcept
Provides a text_reader with no data to read from.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
#define core_export_
Define shared library export.
Definition core_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10