Simplify strHex:

Problem:
- There are several specific overloads with some custom code that can be
  easily replaced using Boost.Hex.

Solution:
- Introduce `strHex(itr, itr)` to return a string given a begin and end
  iterator.
- Remove `strHex(itr, size)` in favor of the `strHex(T)` where T is
  something that has a `begin()` member function. This allows us to
  remove the strHex overloads for `std::string`, Blob, and Slice.
This commit is contained in:
Joe Loser
2018-08-20 22:38:40 -04:00
committed by seelabs
parent 3661dc88fe
commit 1ac9694dbc
17 changed files with 174 additions and 54 deletions

View File

@@ -17,9 +17,9 @@
*/
//==============================================================================
#include <ripple/basics/Slice.h>
#include <ripple/basics/strHex.h>
#include <algorithm>
#include <string>
namespace ripple {
@@ -51,10 +51,4 @@ int charUnHex (unsigned char c)
return xtab[c];
}
std::string
strHex(Slice const& slice)
{
return strHex(slice.data(), slice.size());
}
}