diff options
author | Shaun Verch <shaun.verch@10gen.com> | 2012-09-21 15:51:03 -0700 |
---|---|---|
committer | Shaun Verch <shaun.verch@10gen.com> | 2012-12-18 17:13:43 -0500 |
commit | 0a07acb847cc6e7bc9707a951b2292e701d2d9a4 (patch) | |
tree | b6d9f4c23787d6a22df2764110e8a7fb618366cd /src/mongo/util/hex.h | |
parent | 67ec3ed7d7550cf5d39458c5a6026568a802557a (diff) | |
download | mongo-0a07acb847cc6e7bc9707a951b2292e701d2d9a4.tar.gz |
SERVER-5677 Replaced JSON -> BSON parser
Diffstat (limited to 'src/mongo/util/hex.h')
-rw-r--r-- | src/mongo/util/hex.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/util/hex.h b/src/mongo/util/hex.h index bebe411d944..a39a83e8c3e 100644 --- a/src/mongo/util/hex.h +++ b/src/mongo/util/hex.h @@ -19,6 +19,7 @@ #include <string> +#include "mongo/base/string_data.h" #include "mongo/bson/util/builder.h" namespace mongo { @@ -36,6 +37,9 @@ namespace mongo { inline char fromHex( const char *c ) { return (char)(( fromHex( c[ 0 ] ) << 4 ) | fromHex( c[ 1 ] )); } + inline char fromHex( const StringData& c ) { + return (char)(( fromHex( c[ 0 ] ) << 4 ) | fromHex( c[ 1 ] )); + } inline std::string toHex(const void* inRaw, int len) { static const char hexchars[] = "0123456789ABCDEF"; |