fs/io/*: make constructors "explicit"

This commit is contained in:
Max Kellermann 2017-01-04 10:37:55 +01:00
parent 288b98ccbf
commit 8aae9766e5
10 changed files with 10 additions and 10 deletions

View File

@ -36,7 +36,7 @@ class AutoGunzipReader final : public Reader {
GunzipReader *gunzip = nullptr;
public:
AutoGunzipReader(Reader &_next)
explicit AutoGunzipReader(Reader &_next)
:peek(_next) {}
~AutoGunzipReader();

View File

@ -44,7 +44,7 @@ class BufferedOutputStream {
DynamicFifoBuffer<char> buffer;
public:
BufferedOutputStream(OutputStream &_os)
explicit BufferedOutputStream(OutputStream &_os)
:os(_os), buffer(32768) {}
void Write(const void *data, size_t size);

View File

@ -40,7 +40,7 @@ class BufferedReader {
unsigned line_number = 0;
public:
BufferedReader(Reader &_reader)
explicit BufferedReader(Reader &_reader)
:reader(_reader), buffer(4096) {}
/**

View File

@ -88,7 +88,7 @@ private:
Mode mode;
public:
FileOutputStream(Path _path, Mode _mode=Mode::CREATE);
explicit FileOutputStream(Path _path, Mode _mode=Mode::CREATE);
~FileOutputStream() {
if (IsDefined())

View File

@ -46,7 +46,7 @@ class FileReader final : public Reader {
#endif
public:
FileReader(Path _path);
explicit FileReader(Path _path);
#ifdef WIN32
FileReader(FileReader &&other)

View File

@ -43,7 +43,7 @@ public:
/**
* Construct the filter.
*/
GunzipReader(Reader &_next);
explicit GunzipReader(Reader &_next);
~GunzipReader() {
inflateEnd(&z);

View File

@ -41,7 +41,7 @@ public:
/**
* Construct the filter.
*/
GzipOutputStream(OutputStream &_next);
explicit GzipOutputStream(OutputStream &_next);
~GzipOutputStream();
/**

View File

@ -39,7 +39,7 @@ class PeekReader final : public Reader {
uint8_t buffer[64];
public:
PeekReader(Reader &_next)
explicit PeekReader(Reader &_next)
:next(_next) {}
const void *Peek(size_t size);

View File

@ -30,7 +30,7 @@ class StdioOutputStream final : public OutputStream {
FILE *const file;
public:
StdioOutputStream(FILE *_file):file(_file) {}
explicit StdioOutputStream(FILE *_file):file(_file) {}
/* virtual methods from class OutputStream */
void Write(const void *data, size_t size) override {

View File

@ -38,7 +38,7 @@ class TextFile {
BufferedReader *const buffered_reader;
public:
TextFile(Path path_fs);
explicit TextFile(Path path_fs);
TextFile(const TextFile &other) = delete;