diff options
author | chriseth <chris@ethereum.org> | 2017-08-31 17:49:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-31 17:49:06 +0800 |
commit | 7b6b12ca780c6406d5977d2286a0be3f94cdf114 (patch) | |
tree | 98742d9ec8fecde1f5cb3fa30df7acff6be9ad59 /libdevcore/CommonData.cpp | |
parent | 402d6e713e6d38a00616cdee87d752dd78ee91db (diff) | |
parent | eb33e76416c7e8091bd33365b8b0917a9146868b (diff) | |
download | dexon-solidity-7b6b12ca780c6406d5977d2286a0be3f94cdf114.tar dexon-solidity-7b6b12ca780c6406d5977d2286a0be3f94cdf114.tar.gz dexon-solidity-7b6b12ca780c6406d5977d2286a0be3f94cdf114.tar.bz2 dexon-solidity-7b6b12ca780c6406d5977d2286a0be3f94cdf114.tar.lz dexon-solidity-7b6b12ca780c6406d5977d2286a0be3f94cdf114.tar.xz dexon-solidity-7b6b12ca780c6406d5977d2286a0be3f94cdf114.tar.zst dexon-solidity-7b6b12ca780c6406d5977d2286a0be3f94cdf114.zip |
Merge pull request #2812 from ethereum/removeEscape
Remove escape function.
Diffstat (limited to 'libdevcore/CommonData.cpp')
-rw-r--r-- | libdevcore/CommonData.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/libdevcore/CommonData.cpp b/libdevcore/CommonData.cpp index 14caf494..db11e61c 100644 --- a/libdevcore/CommonData.cpp +++ b/libdevcore/CommonData.cpp @@ -28,34 +28,6 @@ using namespace std; using namespace dev; -std::string dev::escaped(std::string const& _s, bool _all) -{ - static const map<char, char> prettyEscapes{{'\r', 'r'}, {'\n', 'n'}, {'\t', 't'}, {'\v', 'v'}}; - std::string ret; - ret.reserve(_s.size() + 2); - ret.push_back('"'); - for (auto i: _s) - if (i == '"' && !_all) - ret += "\\\""; - else if (i == '\\' && !_all) - ret += "\\\\"; - else if (prettyEscapes.count(i) && !_all) - { - ret += '\\'; - ret += prettyEscapes.find(i)->second; - } - else if (i < ' ' || _all) - { - ret += "\\x"; - ret.push_back("0123456789abcdef"[(uint8_t)i / 16]); - ret.push_back("0123456789abcdef"[(uint8_t)i % 16]); - } - else - ret.push_back(i); - ret.push_back('"'); - return ret; -} - int dev::fromHex(char _i, WhenError _throw) { if (_i >= '0' && _i <= '9') |