aboutsummaryrefslogtreecommitdiff
path: root/src/core_read.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-06 20:16:56 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-01-06 20:32:45 +0100
commit729ba317498bf644c62975dbde07da5ab9ef0043 (patch)
tree84076d547fd499ff98cffac6a9343bccfb451081 /src/core_read.cpp
parent3b95808428c16b2276cf1a6416d0c01ae515e81a (diff)
parent856e862f4a736fbdc38daae3b7f0fa34e1da317c (diff)
downloadbitcoin-729ba317498bf644c62975dbde07da5ab9ef0043.tar.xz
Merge pull request #5513
856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields) 9b1ab86 namespace: drop boost::assign altogether here (Cory Fields) a324199 namespace: remove boost namespace pollution (Cory Fields)
Diffstat (limited to 'src/core_read.cpp')
-rw-r--r--src/core_read.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core_read.cpp b/src/core_read.cpp
index 7999030662..e064955ff0 100644
--- a/src/core_read.cpp
+++ b/src/core_read.cpp
@@ -20,8 +20,6 @@
#include <boost/algorithm/string/split.hpp>
#include <boost/assign/list_of.hpp>
-using namespace boost;
-using namespace boost::algorithm;
using namespace std;
CScript ParseScript(std::string s)
@@ -44,13 +42,13 @@ CScript ParseScript(std::string s)
string strName(name);
mapOpNames[strName] = (opcodetype)op;
// Convenience: OP_ADD and just ADD are both recognized:
- replace_first(strName, "OP_", "");
+ boost::algorithm::replace_first(strName, "OP_", "");
mapOpNames[strName] = (opcodetype)op;
}
}
vector<string> words;
- split(words, s, is_any_of(" \t\n"), token_compress_on);
+ boost::algorithm::split(words, s, boost::algorithm::is_any_of(" \t\n"), boost::algorithm::token_compress_on);
for (std::vector<std::string>::const_iterator w = words.begin(); w != words.end(); ++w)
{
@@ -58,20 +56,20 @@ CScript ParseScript(std::string s)
{
// Empty string, ignore. (boost::split given '' will return one word)
}
- else if (all(*w, is_digit()) ||
- (starts_with(*w, "-") && all(string(w->begin()+1, w->end()), is_digit())))
+ else if (all(*w, boost::algorithm::is_digit()) ||
+ (boost::algorithm::starts_with(*w, "-") && all(string(w->begin()+1, w->end()), boost::algorithm::is_digit())))
{
// Number
int64_t n = atoi64(*w);
result << n;
}
- else if (starts_with(*w, "0x") && (w->begin()+2 != w->end()) && IsHex(string(w->begin()+2, w->end())))
+ else if (boost::algorithm::starts_with(*w, "0x") && (w->begin()+2 != w->end()) && IsHex(string(w->begin()+2, w->end())))
{
// Raw hex data, inserted NOT pushed onto stack:
std::vector<unsigned char> raw = ParseHex(string(w->begin()+2, w->end()));
result.insert(result.end(), raw.begin(), raw.end());
}
- else if (w->size() >= 2 && starts_with(*w, "'") && ends_with(*w, "'"))
+ else if (w->size() >= 2 && boost::algorithm::starts_with(*w, "'") && boost::algorithm::ends_with(*w, "'"))
{
// Single-quoted string, pushed as data. NOTE: this is poor-man's
// parsing, spaces/tabs/newlines in single-quoted strings won't work.