xtd 0.2.0
text_reader.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../array.hpp"
6#include "../core_export.hpp"
7#include "../object.hpp"
8#include "../span.hpp"
9#include "../string.hpp"
10#include <cstdio>
11#include <istream>
12#include <string>
13
15namespace xtd {
17 namespace io {
19 class null_text_reader;
20 class synchronized_text_reader;
22
39 public:
41
48 static null_text_reader& null() noexcept;
50
52
55 virtual void close();
56
59 virtual int32 peek() const;
60
63 virtual int32 read();
64
68 virtual size_t read(xtd::span<char>& buffer);
69
75 virtual size_t read(xtd::array<char>& buffer, size_t index, size_t count);
76
80 virtual size_t read_block(xtd::span<char>& buffer);
81
87 virtual size_t read_block(xtd::array<char>& buffer, size_t index, size_t count);
88
91 virtual xtd::string read_line();
92
96 virtual xtd::string read_to_end();
98
100
105 static synchronized_text_reader synchronised(text_reader& reader) noexcept;
107
108 protected:
110
113 text_reader() = default;
115 };
116
129 public:
131
133 int32 read() override;
135 };
136
149 public:
151
153 int32 read() override;
155
156 private:
157 friend class text_reader;
159 synchronized_text_reader() = delete;
160 xtd::io::text_reader& reader_;
161 };
162 }
163}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Represents a null text reader.
Definition text_reader.hpp:128
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:148
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:38
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:43
Represents a non-owning view over a contiguous sequence of objects.
Definition span.hpp:58
@ io
I/O erreror occurs.
#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