use underscore at end of private members names

This commit is contained in:
gabime 2018-05-26 19:02:58 +03:00
parent b002a21c36
commit 72506b3bab

View File

@ -46,7 +46,7 @@ public:
_filename = fname; _filename = fname;
for (int tries = 0; tries < open_tries; ++tries) for (int tries = 0; tries < open_tries; ++tries)
{ {
if (!os::fopen_s(&_fd, fname, mode)) if (!os::fopen_s(&fd_, fname, mode))
{ {
return; return;
} }
@ -68,15 +68,15 @@ public:
void flush() void flush()
{ {
std::fflush(_fd); std::fflush(fd_);
} }
void close() void close()
{ {
if (_fd != nullptr) if (fd_ != nullptr)
{ {
std::fclose(_fd); std::fclose(fd_);
_fd = nullptr; fd_ = nullptr;
} }
} }
@ -84,7 +84,7 @@ public:
{ {
size_t msg_size = msg.formatted.size(); size_t msg_size = msg.formatted.size();
auto data = msg.formatted.data(); auto data = msg.formatted.data();
if (std::fwrite(data, 1, msg_size, _fd) != msg_size) if (std::fwrite(data, 1, msg_size, fd_) != msg_size)
{ {
throw spdlog_ex("Failed writing to file " + os::filename_to_str(_filename), errno); throw spdlog_ex("Failed writing to file " + os::filename_to_str(_filename), errno);
} }
@ -92,11 +92,11 @@ public:
size_t size() const size_t size() const
{ {
if (_fd == nullptr) if (fd_ == nullptr)
{ {
throw spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(_filename)); throw spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(_filename));
} }
return os::filesize(_fd); return os::filesize(fd_);
} }
const filename_t &filename() const const filename_t &filename() const
@ -144,7 +144,7 @@ public:
} }
private: private:
FILE *_fd{nullptr}; FILE *fd_{nullptr};
filename_t _filename; filename_t _filename;
}; };
} // namespace details } // namespace details