fs/io/*: make constructors "explicit"
This commit is contained in:
parent
288b98ccbf
commit
8aae9766e5
@ -36,7 +36,7 @@ class AutoGunzipReader final : public Reader {
|
|||||||
GunzipReader *gunzip = nullptr;
|
GunzipReader *gunzip = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AutoGunzipReader(Reader &_next)
|
explicit AutoGunzipReader(Reader &_next)
|
||||||
:peek(_next) {}
|
:peek(_next) {}
|
||||||
~AutoGunzipReader();
|
~AutoGunzipReader();
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class BufferedOutputStream {
|
|||||||
DynamicFifoBuffer<char> buffer;
|
DynamicFifoBuffer<char> buffer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BufferedOutputStream(OutputStream &_os)
|
explicit BufferedOutputStream(OutputStream &_os)
|
||||||
:os(_os), buffer(32768) {}
|
:os(_os), buffer(32768) {}
|
||||||
|
|
||||||
void Write(const void *data, size_t size);
|
void Write(const void *data, size_t size);
|
||||||
|
@ -40,7 +40,7 @@ class BufferedReader {
|
|||||||
unsigned line_number = 0;
|
unsigned line_number = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BufferedReader(Reader &_reader)
|
explicit BufferedReader(Reader &_reader)
|
||||||
:reader(_reader), buffer(4096) {}
|
:reader(_reader), buffer(4096) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,7 +88,7 @@ private:
|
|||||||
Mode mode;
|
Mode mode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FileOutputStream(Path _path, Mode _mode=Mode::CREATE);
|
explicit FileOutputStream(Path _path, Mode _mode=Mode::CREATE);
|
||||||
|
|
||||||
~FileOutputStream() {
|
~FileOutputStream() {
|
||||||
if (IsDefined())
|
if (IsDefined())
|
||||||
|
@ -46,7 +46,7 @@ class FileReader final : public Reader {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FileReader(Path _path);
|
explicit FileReader(Path _path);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
FileReader(FileReader &&other)
|
FileReader(FileReader &&other)
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Construct the filter.
|
* Construct the filter.
|
||||||
*/
|
*/
|
||||||
GunzipReader(Reader &_next);
|
explicit GunzipReader(Reader &_next);
|
||||||
|
|
||||||
~GunzipReader() {
|
~GunzipReader() {
|
||||||
inflateEnd(&z);
|
inflateEnd(&z);
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Construct the filter.
|
* Construct the filter.
|
||||||
*/
|
*/
|
||||||
GzipOutputStream(OutputStream &_next);
|
explicit GzipOutputStream(OutputStream &_next);
|
||||||
~GzipOutputStream();
|
~GzipOutputStream();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,7 +39,7 @@ class PeekReader final : public Reader {
|
|||||||
uint8_t buffer[64];
|
uint8_t buffer[64];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PeekReader(Reader &_next)
|
explicit PeekReader(Reader &_next)
|
||||||
:next(_next) {}
|
:next(_next) {}
|
||||||
|
|
||||||
const void *Peek(size_t size);
|
const void *Peek(size_t size);
|
||||||
|
@ -30,7 +30,7 @@ class StdioOutputStream final : public OutputStream {
|
|||||||
FILE *const file;
|
FILE *const file;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StdioOutputStream(FILE *_file):file(_file) {}
|
explicit StdioOutputStream(FILE *_file):file(_file) {}
|
||||||
|
|
||||||
/* virtual methods from class OutputStream */
|
/* virtual methods from class OutputStream */
|
||||||
void Write(const void *data, size_t size) override {
|
void Write(const void *data, size_t size) override {
|
||||||
|
@ -38,7 +38,7 @@ class TextFile {
|
|||||||
BufferedReader *const buffered_reader;
|
BufferedReader *const buffered_reader;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TextFile(Path path_fs);
|
explicit TextFile(Path path_fs);
|
||||||
|
|
||||||
TextFile(const TextFile &other) = delete;
|
TextFile(const TextFile &other) = delete;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user