add FileSize::operator std::string() const
This commit is contained in:
parent
feac7be191
commit
79e47c3cda
6
Log.cpp
6
Log.cpp
|
@ -297,6 +297,12 @@ std::ostream& operator<<(std::ostream& str, const PrintErrno&) {
|
|||
return str << strerror(errno) << " (" << errno << ')';
|
||||
}
|
||||
|
||||
FileSize::operator std::string() const {
|
||||
std::ostringstream str;
|
||||
str << *this;
|
||||
return str.str();
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& str, const FileSize& fs) {
|
||||
static const char PREFIX[] {' ', 'K', 'M', 'G', 'T', 'P', 'E'};
|
||||
static const uint_fast8_t PREFIXCOUNT = 7;
|
||||
|
|
Loading…
Reference in New Issue