From 856e862f4a736fbdc38daae3b7f0fa34e1da317c Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Fri, 19 Dec 2014 16:50:15 -0500 Subject: namespace: drop most boost namespaces and a few header cleanups A few boost::asio were left around because they're very wordy otherwise. --- src/core_read.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/core_read.cpp') diff --git a/src/core_read.cpp b/src/core_read.cpp index 85b60e9adb..e064955ff0 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -20,7 +20,6 @@ #include #include -using namespace boost::algorithm; using namespace std; CScript ParseScript(std::string s) @@ -43,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 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::const_iterator w = words.begin(); w != words.end(); ++w) { @@ -57,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 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. -- cgit v1.2.3