Mercurial > hg > orthanc
comparison OrthancServer/FromDcmtkBridge.cpp @ 2017:08ce34cfacad
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 13 Jun 2016 15:49:10 +0200 |
parents | 655489d9165d |
children | 4a151d26c98a |
comparison
equal
deleted
inserted
replaced
2016:0ae26237569a | 2017:08ce34cfacad |
---|---|
113 | 113 |
114 #if DCMTK_USE_EMBEDDED_DICTIONARIES == 1 | 114 #if DCMTK_USE_EMBEDDED_DICTIONARIES == 1 |
115 static void LoadEmbeddedDictionary(DcmDataDictionary& dictionary, | 115 static void LoadEmbeddedDictionary(DcmDataDictionary& dictionary, |
116 EmbeddedResources::FileResourceId resource) | 116 EmbeddedResources::FileResourceId resource) |
117 { | 117 { |
118 std::string content; | |
119 EmbeddedResources::GetFileResource(content, resource); | |
120 | |
118 Toolbox::TemporaryFile tmp; | 121 Toolbox::TemporaryFile tmp; |
119 | 122 tmp.Write(content); |
120 FILE* fp = fopen(tmp.GetPath().c_str(), "wb"); | |
121 fwrite(EmbeddedResources::GetFileResourceBuffer(resource), | |
122 EmbeddedResources::GetFileResourceSize(resource), 1, fp); | |
123 fclose(fp); | |
124 | 123 |
125 if (!dictionary.loadDictionary(tmp.GetPath().c_str())) | 124 if (!dictionary.loadDictionary(tmp.GetPath().c_str())) |
126 { | 125 { |
126 LOG(ERROR) << "Cannot read embedded dictionary. Under Windows, make sure that " | |
127 << "your TEMP directory does not contain special characters."; | |
127 throw OrthancException(ErrorCode_InternalError); | 128 throw OrthancException(ErrorCode_InternalError); |
128 } | 129 } |
129 } | 130 } |
130 | 131 |
131 #else | 132 #else |