Mercurial > hg > orthanc
diff OrthancFramework/Sources/SerializationToolbox.h @ 4775:add0337b928a
refactoring parsing of numbers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 30 Aug 2021 10:24:36 +0200 |
parents | f4dbdb2dcba6 |
children | 7053502fbf97 |
line wrap: on
line diff
--- a/OrthancFramework/Sources/SerializationToolbox.h Wed Aug 25 17:20:21 2021 +0200 +++ b/OrthancFramework/Sources/SerializationToolbox.h Mon Aug 30 10:24:36 2021 +0200 @@ -101,5 +101,41 @@ static void WriteMapOfTags(Json::Value& target, const std::map<DicomTag, std::string>& values, const std::string& field); + + static bool ParseInteger32(int32_t& result, + const std::string& value); + + static bool ParseInteger64(int64_t& result, + const std::string& value); + + static bool ParseUnsignedInteger32(uint32_t& result, + const std::string& value); + + static bool ParseUnsignedInteger64(uint64_t& result, + const std::string& value); + + static bool ParseFloat(float& result, + const std::string& value); + + static bool ParseDouble(double& result, + const std::string& value); + + static bool ParseFirstInteger32(int32_t& result, + const std::string& value); + + static bool ParseFirstInteger64(int64_t& result, + const std::string& value); + + static bool ParseFirstUnsignedInteger32(uint32_t& result, + const std::string& value); + + static bool ParseFirstUnsignedInteger64(uint64_t& result, + const std::string& value); + + static bool ParseFirstFloat(float& result, + const std::string& value); + + static bool ParseFirstDouble(double& result, + const std::string& value); }; }