use stding
This commit is contained in:
parent
d08f05888d
commit
49ad782f7c
@ -670,7 +670,7 @@ bool pcSubst(const string& in, string& out, const map<string, string>& subs)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
inline static int ulltorbuf(unsigned long long val, char *rbuf)
|
||||
inline static int ulltorbuf(uint64_t val, char *rbuf)
|
||||
{
|
||||
int idx;
|
||||
for (idx = 0; val; idx++) {
|
||||
@ -690,7 +690,7 @@ inline static void ullcopyreverse(const char *rbuf, string& buf, int idx)
|
||||
}
|
||||
}
|
||||
|
||||
void ulltodecstr(unsigned long long val, string& buf)
|
||||
void ulltodecstr(uint64_t val, string& buf)
|
||||
{
|
||||
buf.clear();
|
||||
if (val == 0) {
|
||||
@ -705,7 +705,7 @@ void ulltodecstr(unsigned long long val, string& buf)
|
||||
return;
|
||||
}
|
||||
|
||||
void lltodecstr(long long val, string& buf)
|
||||
void lltodecstr(int64_t val, string& buf)
|
||||
{
|
||||
buf.clear();
|
||||
if (val == 0) {
|
||||
@ -730,14 +730,14 @@ void lltodecstr(long long val, string& buf)
|
||||
return;
|
||||
}
|
||||
|
||||
string lltodecstr(long long val)
|
||||
string lltodecstr(int64_t val)
|
||||
{
|
||||
string buf;
|
||||
lltodecstr(val, buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
string ulltodecstr(unsigned long long val)
|
||||
string ulltodecstr(uint64_t val)
|
||||
{
|
||||
string buf;
|
||||
ulltodecstr(val, buf);
|
||||
@ -745,7 +745,7 @@ string ulltodecstr(unsigned long long val)
|
||||
}
|
||||
|
||||
// Convert byte count into unit (KB/MB...) appropriate for display
|
||||
string displayableBytes(off_t size)
|
||||
string displayableBytes(int64_t size)
|
||||
{
|
||||
const char *unit;
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#define _SMALLUT_H_INCLUDED_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -162,13 +163,13 @@ extern std::string escapeShell(const std::string& str);
|
||||
extern std::string truncate_to_word(const std::string& input,
|
||||
std::string::size_type maxlen);
|
||||
|
||||
void ulltodecstr(unsigned long long val, std::string& buf);
|
||||
void lltodecstr(long long val, std::string& buf);
|
||||
std::string lltodecstr(long long val);
|
||||
std::string ulltodecstr(unsigned long long val);
|
||||
void ulltodecstr(uint64_t val, std::string& buf);
|
||||
void lltodecstr(int64_t val, std::string& buf);
|
||||
std::string lltodecstr(int64_t val);
|
||||
std::string ulltodecstr(uint64_t val);
|
||||
|
||||
/** Convert byte count into unit (KB/MB...) appropriate for display */
|
||||
std::string displayableBytes(off_t size);
|
||||
std::string displayableBytes(int64_t size);
|
||||
|
||||
/** Break big string into lines */
|
||||
std::string breakIntoLines(const std::string& in, unsigned int ll = 100,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user