diff --git a/services/backup/src/Tools.h b/services/backup/src/Tools.h --- a/services/backup/src/Tools.h +++ b/services/backup/src/Tools.h @@ -1,5 +1,7 @@ #pragma once +#include + #include namespace comm { @@ -15,6 +17,10 @@ std::string validateAttachmentHolders(const std::string &holders); +int charPtrToInt(const char *str); + +size_t getBlobPutField(blob::PutRequest::DataCase field); + } // namespace tools } // namespace network } // namespace comm diff --git a/services/backup/src/Tools.cpp b/services/backup/src/Tools.cpp --- a/services/backup/src/Tools.cpp +++ b/services/backup/src/Tools.cpp @@ -52,6 +52,20 @@ return result; } +int charPtrToInt(const char *str) { + unsigned int intValue; + std::stringstream strValue; + + strValue << str; + strValue >> intValue; + + return intValue; +} + +size_t getBlobPutField(blob::PutRequest::DataCase field) { + return static_cast(field); +} + } // namespace tools } // namespace network } // namespace comm