Mercurial > hg > orthanc
changeset 3655:e7248fa2738f
merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Fri, 07 Feb 2020 09:35:36 +0100 |
parents | 427a13084241 (diff) 468181e2f090 (current diff) |
children | cccd97333e3d b7cf2e32aafb |
files | |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Resources/Samples/CppHelpers/Logging/ILogger.h Wed Feb 05 15:23:22 2020 +0100 +++ b/Resources/Samples/CppHelpers/Logging/ILogger.h Fri Feb 07 09:35:36 2020 +0100 @@ -8,6 +8,21 @@ namespace OrthancHelpers { + + inline std::string ShortenId(const std::string& orthancUuid) + { + size_t firstHyphenPos = orthancUuid.find_first_of('-'); + if (firstHyphenPos == std::string::npos) + { + return orthancUuid; + } + else + { + return orthancUuid.substr(0, firstHyphenPos); + } + } + + // Interface for loggers providing the same interface // in Orthanc framework or in an Orthanc plugins. // Furthermore, compared to the LOG and VLOG macros,