diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2014-12-19 16:50:15 -0500 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2015-01-02 15:12:03 -0500 |
commit | 856e862f4a736fbdc38daae3b7f0fa34e1da317c (patch) | |
tree | 2095eef431d539acfef432321aa82fa6062219fa /src/core_read.cpp | |
parent | 9b1ab860ff00180142d9e514f3e1b6a91c86df7a (diff) |
namespace: drop most boost namespaces and a few header cleanups
A few boost::asio were left around because they're very wordy otherwise.
Diffstat (limited to 'src/core_read.cpp')
-rw-r--r-- | src/core_read.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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 <boost/algorithm/string/split.hpp> #include <boost/assign/list_of.hpp> -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<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) { @@ -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<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. |