]> git.saurik.com Git - apple/system_cmds.git/blobdiff - CPPUtil/UtilPrettyPrinting.cpp
system_cmds-735.tar.gz
[apple/system_cmds.git] / CPPUtil / UtilPrettyPrinting.cpp
diff --git a/CPPUtil/UtilPrettyPrinting.cpp b/CPPUtil/UtilPrettyPrinting.cpp
deleted file mode 100644 (file)
index 00c1ea0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-//
-//  UtilPrettyPrinting.cpp
-//  CPPUtil
-//
-//  Created by James McIlree on 9/8/13.
-//  Copyright (c) 2013 Apple. All rights reserved.
-//
-
-#include "CPPUtil.h"
-
-BEGIN_UTIL_NAMESPACE
-
-std::string formated_byte_size(uint64_t bytes) {
-       if (bytes) {
-               char tmp[128];
-               const char *si_prefix[] = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" };
-               const int base = 1024;
-               int c = std::min((int)(log((double)bytes)/log((double)base)), (int)sizeof(si_prefix) - 1);
-               snprintf(tmp, sizeof(tmp), "%1.2f %s", bytes / pow((double)base, c), si_prefix[c]);
-               return std::string(tmp);
-       }
-
-       return std::string("0.00 B");
-}
-
-END_UTIL_NAMESPACE