comparison OrthancFramework/Sources/FileStorage/MemoryStorageArea.cpp @ 5398:08b5516c6e5e

compatibility of OrthancFramework with latest releases of Emscripten
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 11 Oct 2023 15:26:45 +0200
parents 0ea402b4d901
children b83192e7ad10
comparison
equal deleted inserted replaced
5397:e7f6ec8cbc35 5398:08b5516c6e5e
47 FileContentType type) 47 FileContentType type)
48 { 48 {
49 LOG(INFO) << "Creating attachment \"" << uuid << "\" of \"" << static_cast<int>(type) 49 LOG(INFO) << "Creating attachment \"" << uuid << "\" of \"" << static_cast<int>(type)
50 << "\" type (size: " << (size / (1024 * 1024) + 1) << "MB)"; 50 << "\" type (size: " << (size / (1024 * 1024) + 1) << "MB)";
51 51
52 boost::mutex::scoped_lock lock(mutex_); 52 Mutex::ScopedLock lock(mutex_);
53 53
54 if (size != 0 && 54 if (size != 0 &&
55 content == NULL) 55 content == NULL)
56 { 56 {
57 throw OrthancException(ErrorCode_NullPointer); 57 throw OrthancException(ErrorCode_NullPointer);
71 FileContentType type) 71 FileContentType type)
72 { 72 {
73 LOG(INFO) << "Reading attachment \"" << uuid << "\" of \"" 73 LOG(INFO) << "Reading attachment \"" << uuid << "\" of \""
74 << static_cast<int>(type) << "\" content type"; 74 << static_cast<int>(type) << "\" content type";
75 75
76 boost::mutex::scoped_lock lock(mutex_); 76 Mutex::ScopedLock lock(mutex_);
77 77
78 Content::const_iterator found = content_.find(uuid); 78 Content::const_iterator found = content_.find(uuid);
79 79
80 if (found == content_.end()) 80 if (found == content_.end())
81 { 81 {
109 { 109 {
110 return new StringMemoryBuffer; 110 return new StringMemoryBuffer;
111 } 111 }
112 else 112 else
113 { 113 {
114 boost::mutex::scoped_lock lock(mutex_); 114 Mutex::ScopedLock lock(mutex_);
115 115
116 Content::const_iterator found = content_.find(uuid); 116 Content::const_iterator found = content_.find(uuid);
117 117
118 if (found == content_.end()) 118 if (found == content_.end())
119 { 119 {
150 void MemoryStorageArea::Remove(const std::string& uuid, 150 void MemoryStorageArea::Remove(const std::string& uuid,
151 FileContentType type) 151 FileContentType type)
152 { 152 {
153 LOG(INFO) << "Deleting attachment \"" << uuid << "\" of type " << static_cast<int>(type); 153 LOG(INFO) << "Deleting attachment \"" << uuid << "\" of type " << static_cast<int>(type);
154 154
155 boost::mutex::scoped_lock lock(mutex_); 155 Mutex::ScopedLock lock(mutex_);
156 156
157 Content::iterator found = content_.find(uuid); 157 Content::iterator found = content_.find(uuid);
158 158
159 if (found == content_.end()) 159 if (found == content_.end())
160 { 160 {