Changeset View
Changeset View
Standalone View
Standalone View
src/utilstrencodings.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "utilstrencodings.h" | #include "utilstrencodings.h" | ||||
#include "tinyformat.h" | #include "tinyformat.h" | ||||
#include <algorithm> | |||||
#include <cerrno> | #include <cerrno> | ||||
#include <cstdlib> | #include <cstdlib> | ||||
#include <cstring> | #include <cstring> | ||||
#include <limits> | #include <limits> | ||||
static const std::string CHARS_ALPHA_NUM = | static const std::string CHARS_ALPHA_NUM = | ||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | ||||
▲ Show 20 Lines • Show All 780 Lines • ▼ Show 20 Lines | bool ParseFixedPoint(const std::string &val, int decimals, | ||||
} | } | ||||
if (amount_out) { | if (amount_out) { | ||||
*amount_out = mantissa; | *amount_out = mantissa; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
void Downcase(std::string &str) { | |||||
std::transform(str.begin(), str.end(), str.begin(), | |||||
[](unsigned char c) { return ToLower(c); }); | |||||
} | |||||
std::string Capitalize(std::string str) { | |||||
if (str.empty()) return str; | |||||
Fabien: Braces | |||||
str[0] = ToUpper(str.front()); | |||||
return str; | |||||
} |
Braces