| 53 | } |
| 54 | |
| 55 | QString GetMemorySizeNumString(int64_t size) { |
| 56 | constexpr double kbThreshold = 1024; |
| 57 | constexpr double mbThreshold = 1024 * 1024; |
| 58 | constexpr double gbThreshold = 1024 * 1024 * 1024; |
| 59 | double dSize = static_cast<double>(size); |
| 60 | if (dSize < kbThreshold) { |
| 61 | return ToQString(size); |
| 62 | } |
| 63 | if (dSize < mbThreshold) { |
| 64 | return ToQString(dSize / static_cast<double>(kbThreshold)); |
| 65 | } |
| 66 | if (dSize < gbThreshold) { |
| 67 | return ToQString(dSize / static_cast<double>(mbThreshold)); |
| 68 | } |
| 69 | return ToQString(dSize / static_cast<double>(gbThreshold)); |
| 70 | } |
| 71 | |
| 72 | using TagCodeVersionPair = std::pair<TagCode, std::string>; |
| 73 | static const std::vector<TagCodeVersionPair> TagCodeVersionList = { |