Refactor: Remove using namespace <xxx> from util*

This commit is contained in:
Karl-Johan Alm
2017-01-27 10:34:06 +09:00
parent 8a5228197c
commit a57845c20e
4 changed files with 46 additions and 52 deletions

View File

@@ -9,8 +9,6 @@
#include "tinyformat.h"
#include "utilstrencodings.h"
using namespace std;
std::string FormatMoney(const CAmount& n)
{
// Note: not using straight sprintf here because we do NOT want
@@ -18,7 +16,7 @@ std::string FormatMoney(const CAmount& n)
int64_t n_abs = (n > 0 ? n : -n);
int64_t quotient = n_abs/COIN;
int64_t remainder = n_abs%COIN;
string str = strprintf("%d.%08d", quotient, remainder);
std::string str = strprintf("%d.%08d", quotient, remainder);
// Right-trim excess zeros before the decimal point:
int nTrim = 0;
@@ -33,14 +31,14 @@ std::string FormatMoney(const CAmount& n)
}
bool ParseMoney(const string& str, CAmount& nRet)
bool ParseMoney(const std::string& str, CAmount& nRet)
{
return ParseMoney(str.c_str(), nRet);
}
bool ParseMoney(const char* pszIn, CAmount& nRet)
{
string strWhole;
std::string strWhole;
int64_t nUnits = 0;
const char* p = pszIn;
while (isspace(*p))