Mercurial > hg > orthanc-stone
diff Resources/Orthanc/Core/Toolbox.h @ 206:795d71f66f31
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 29 Mar 2018 10:09:03 +0200 |
parents | 03afbee0cc7b |
children |
line wrap: on
line diff
--- a/Resources/Orthanc/Core/Toolbox.h Wed Mar 28 11:29:13 2018 +0200 +++ b/Resources/Orthanc/Core/Toolbox.h Thu Mar 29 10:09:03 2018 +0200 @@ -79,6 +79,24 @@ namespace Toolbox { + class LinesIterator + { + private: + const std::string& content_; + size_t lineStart_; + size_t lineEnd_; + + void FindEndOfLine(); + + public: + LinesIterator(const std::string& content); + + bool GetLine(std::string& target) const; + + void Next(); + }; + + void ToUpperCase(std::string& s); // Inplace version void ToLowerCase(std::string& s); // Inplace version @@ -214,5 +232,28 @@ std::string ToUpperCaseWithAccents(const std::string& source); #endif + + std::string GenerateUuid(); } } + + + + +/** + * The plain C, opaque data structure "OrthancLinesIterator" is a thin + * wrapper around Orthanc::Toolbox::LinesIterator, and is only used by + * "../Resources/WebAssembly/dcdict.cc", in order to avoid code + * duplication + **/ + +struct OrthancLinesIterator; + +OrthancLinesIterator* OrthancLinesIterator_Create(const std::string& content); + +bool OrthancLinesIterator_GetLine(std::string& target, + const OrthancLinesIterator* iterator); + +void OrthancLinesIterator_Next(OrthancLinesIterator* iterator); + +void OrthancLinesIterator_Free(OrthancLinesIterator* iterator);