Mercurial > hg > orthanc
comparison OrthancServer/ServerEnumerations.cpp @ 437:beca6747945e
PUT on metadata
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 15 May 2013 16:43:30 +0200 |
parents | d51186bf7602 |
children | 3b735fdf320b |
comparison
equal
deleted
inserted
replaced
436:d51186bf7602 | 437:beca6747945e |
---|---|
66 } | 66 } |
67 | 67 |
68 dictMetadataType_.Add(static_cast<MetadataType>(metadata), name); | 68 dictMetadataType_.Add(static_cast<MetadataType>(metadata), name); |
69 } | 69 } |
70 | 70 |
71 const char* EnumerationToString(MetadataType type) | 71 std::string EnumerationToString(MetadataType type) |
72 { | 72 { |
73 boost::mutex::scoped_lock lock(enumerationsMutex_); | 73 // This function MUST return a "std::string" and not "const |
74 return dictMetadataType_.Translate(type).c_str(); | 74 // char*", as the result is not a static string |
75 boost::mutex::scoped_lock lock(enumerationsMutex_); | |
76 return dictMetadataType_.Translate(type); | |
75 } | 77 } |
76 | 78 |
77 MetadataType StringToMetadata(const std::string& str) | 79 MetadataType StringToMetadata(const std::string& str) |
78 { | 80 { |
79 boost::mutex::scoped_lock lock(enumerationsMutex_); | 81 boost::mutex::scoped_lock lock(enumerationsMutex_); |