Doing away with boost in ldb_cmd.h
Summary: boost functions cause complications while deploying to third-party Test Plan: make Reviewers: sheki, dhruba Reviewed By: sheki Differential Revision: https://reviews.facebook.net/D9441
This commit is contained in:
parent
5a8c8845a9
commit
a78fb5e8bc
@ -12,9 +12,6 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <boost/algorithm/string/case_conv.hpp>
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
|
||||||
|
|
||||||
#include "leveldb/db.h"
|
#include "leveldb/db.h"
|
||||||
#include "leveldb/env.h"
|
#include "leveldb/env.h"
|
||||||
#include "leveldb/options.h"
|
#include "leveldb/options.h"
|
||||||
@ -102,7 +99,7 @@ public:
|
|||||||
|
|
||||||
static string HexToString(const string& str) {
|
static string HexToString(const string& str) {
|
||||||
string parsed;
|
string parsed;
|
||||||
if (!boost::starts_with(str, "0x")) {
|
if (str[0] == '0' && str[1] == 'x') {
|
||||||
fprintf(stderr, "Invalid hex input %s. Must start with 0x\n",
|
fprintf(stderr, "Invalid hex input %s. Must start with 0x\n",
|
||||||
str.c_str());
|
str.c_str());
|
||||||
throw "Invalid hex input";
|
throw "Invalid hex input";
|
||||||
@ -301,7 +298,7 @@ private:
|
|||||||
* Otherwise an exception is thrown.
|
* Otherwise an exception is thrown.
|
||||||
*/
|
*/
|
||||||
bool StringToBool(string val) {
|
bool StringToBool(string val) {
|
||||||
boost::algorithm::to_lower(val);
|
std::transform(val.begin(), val.end(), val.begin(), ::tolower);
|
||||||
if (val == "true") {
|
if (val == "true") {
|
||||||
return true;
|
return true;
|
||||||
} else if (val == "false") {
|
} else if (val == "false") {
|
||||||
|
Loading…
Reference in New Issue
Block a user