Compare commits
No commits in common. "f690cd20e528923c6b0894b22d9f7cf40cedbcfd" and "cd1d5bfc64c8bf4bc9c935c66725a272a56ca353" have entirely different histories.
f690cd20e5
...
cd1d5bfc64
@ -46,7 +46,6 @@ public:
|
||||
|
||||
public:
|
||||
static ofString now_time();
|
||||
static ofString get_file_size(long long bytes);
|
||||
};
|
||||
|
||||
class CMutBuffer
|
||||
|
@ -85,32 +85,6 @@ ofString OfUtil::now_time()
|
||||
#endif
|
||||
}
|
||||
|
||||
ofString OfUtil::get_file_size(long long bytes)
|
||||
{
|
||||
constexpr long long gbblk = 1024 * 1024 * 1024;
|
||||
constexpr long long mbblk = 1024 * 1024;
|
||||
|
||||
long long gb = bytes / gbblk;
|
||||
bytes %= gbblk;
|
||||
|
||||
long long mb = bytes / mbblk;
|
||||
bytes %= mbblk;
|
||||
|
||||
long long kb = bytes / 1024;
|
||||
|
||||
std::ostringstream oss;
|
||||
if (gb > 0) {
|
||||
oss << gb << ofT("GB");
|
||||
}
|
||||
if (mb > 0 || gb > 0) {
|
||||
oss << mb << ofT("MB");
|
||||
}
|
||||
if (kb > 0 || mb > 0 || gb > 0) {
|
||||
oss << kb << ofT("KB");
|
||||
}
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
std::string CCodec::u8ToGBK(const std::string& str)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user