xtd 0.2.0
Loading...
Searching...
No Matches
text_reader.h
Go to the documentation of this file.
1
4#pragma once
5#include "../core_export.h"
6#include "../object.h"
7#include "../ustring.h"
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
35 public:
37
44 static null_text_reader& null() noexcept;
46
48
51 virtual void close();
52
55 virtual int32 peek() const;
56
59 virtual int32 read();
60
66 virtual size_t read(std::vector<char>& buffer, size_t index, size_t count);
67
73 virtual size_t read_block(std::vector<char>& buffer, size_t index, size_t count);
74
77 virtual xtd::ustring read_line();
78
82 virtual xtd::ustring read_to_end();
84
86
91 static synchronized_text_reader synchronised(text_reader& reader) noexcept;
93
94 protected:
96
99 text_reader() = default;
101 };
102
115 public:
117
119 int32 read() override;
121 };
122
135 public:
137
139 int32 read() override;
141
142 private:
143 friend class text_reader;
145 synchronized_text_reader() = delete;
146 xtd::io::text_reader& reader_;
147 };
148 }
149}
Represents a null text reader.
Definition text_reader.h:114
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.h:134
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.h:34
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.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define core_export_
Define shared library export.
Definition core_export.h:13
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10