From 691bdd1d1eedcb63af9decc739a320d06b0ed4d0 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 15 Jun 2016 22:38:25 +0100 Subject: [PATCH] Use new custom lexical_cast instead of the one from boost. --- src/backends/redis/backend_redis.cpp | 14 +++++++------- src/backends/redis/scan_iterator.cpp | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/backends/redis/backend_redis.cpp b/src/backends/redis/backend_redis.cpp index 8c5d484..2efa315 100644 --- a/src/backends/redis/backend_redis.cpp +++ b/src/backends/redis/backend_redis.cpp @@ -19,11 +19,11 @@ #include "dindexer-machinery/recorddata.hpp" #include "backends/exposed_functions.hpp" #include "backends/backend_version.hpp" +#include "helpers/lexical_cast.hpp" #include "dindexerConfig.h" #include "helpers/stringize.h" #include #include -#include #include #include @@ -36,7 +36,7 @@ namespace dindb { }; std::pair pair_list_to_file_record (const redis::Command::hscan_range& parRange, const mchlib::TigerHash& parHash) { - using boost::lexical_cast; + using dinhelp::lexical_cast; mchlib::FileRecordData retval; retval.hash = parHash; @@ -77,7 +77,7 @@ namespace dindb { } mchlib::SetRecordDataFull pair_list_to_set_record (const redis::Command::hscan_range& parRange) { - using boost::lexical_cast; + using dinhelp::lexical_cast; mchlib::SetRecordDataFull retval; for (const auto& itm : parRange) { @@ -88,9 +88,9 @@ namespace dindb { else if (itm.first == "fs_uuid") retval.fs_uuid = itm.second; else if (itm.first == "type") - retval.type = lexical_cast(itm.second[0]); + retval.type = itm.second[0]; else if (itm.first == "content_type") - retval.content_type = lexical_cast(itm.second[0]); + retval.content_type = itm.second[0]; } return retval; } @@ -137,7 +137,7 @@ namespace dindb { } void BackendRedis::connect() { - using boost::lexical_cast; + using dinhelp::lexical_cast; m_redis.connect(); if (m_redis.is_connected() and m_database > 0) { @@ -172,7 +172,7 @@ namespace dindb { } void BackendRedis::write_files (const std::vector& parData, const mchlib::SetRecordDataFull& parSetData, const std::string& parSignature) { - using boost::lexical_cast; + using dinhelp::lexical_cast; using boost::string_ref; redis::Reply set_id_reply = m_redis.run("HINCRBY", PROGRAM_NAME ":indices", "set", "1"); diff --git a/src/backends/redis/scan_iterator.cpp b/src/backends/redis/scan_iterator.cpp index 4f9d67e..593e4ed 100644 --- a/src/backends/redis/scan_iterator.cpp +++ b/src/backends/redis/scan_iterator.cpp @@ -16,10 +16,10 @@ */ #include "scan_iterator.hpp" +#include "helpers/lexical_cast.hpp" #include "command.hpp" #include #include -#include #include namespace redis { @@ -42,8 +42,8 @@ namespace redis { } Reply ScanIteratorBaseClass::run (const char* parCommand, long long parScanContext, std::size_t parCount) { - const auto scan_context = boost::lexical_cast(parScanContext); - const auto count_hint = boost::lexical_cast(parCount); + const auto scan_context = dinhelp::lexical_cast(parScanContext); + const auto count_hint = dinhelp::lexical_cast(parCount); if (m_match_pattern.empty()) return m_command->run(parCommand, scan_context, "COUNT", count_hint); else @@ -51,8 +51,8 @@ namespace redis { } Reply ScanIteratorBaseClass::run (const char* parCommand, const boost::string_ref& parParameter, long long parScanContext, std::size_t parCount) { - const auto scan_context = boost::lexical_cast(parScanContext); - const auto count_hint = boost::lexical_cast(parCount); + const auto scan_context = dinhelp::lexical_cast(parScanContext); + const auto count_hint = dinhelp::lexical_cast(parCount); if (m_match_pattern.empty()) return m_command->run(parCommand, parParameter, scan_context, "COUNT", count_hint); else