-void gdcmDictSet::SetDictPath(void) {
- const char* EnvPath = (char*)0;
- EnvPath = getenv("GDCM_DICT_PATH");
- if (EnvPath && (strlen(EnvPath) != 0)) {
- DictPath = EnvPath;
- if (DictPath[DictPath.length() -1] != '/' )
- DictPath += '/';
- dbg.Verbose(1, "gdcmDictSet::SetDictPath:",
- "Dictionary path set from environnement");
- } else
- DictPath = PUB_DICT_PATH;
+/**
+ * \brief Create a DictEntry which will be referenced in no dictionary
+ * @param group Group number of the Entry
+ * @param elem Element number of the Entry
+ * @param vr Value Representation of the Entry
+ * @param vm Value Multiplicity of the Entry
+ * @param name English name of the Entry
+ * @return virtual entry
+ */
+DictEntry *DictSet::NewVirtualDictEntry( uint16_t group,
+ uint16_t elem,
+ TagName vr,
+ TagName vm,
+ TagName name)
+{
+ DictEntry *entry;
+
+ // Let's follow 'Purify' advice
+ //
+ // const std::string tag = DictEntry::TranslateToKey(group,elem)
+ // + "#" + vr + "#" + vm + "#" + name;
+ char res[10];
+ sprintf(res,"%04x|%04x", group, elem);
+ std::string tag = res;
+ tag += "#" + vr + "#" + vm + "#" + name;
+
+ TagKeyHT::iterator it;
+
+ it = VirtualEntries.find(tag);
+ if(it != VirtualEntries.end())
+ {
+ entry = &(it->second);
+ }
+ else
+ {
+ DictEntry ent(group, elem, vr, vm, name);
+ VirtualEntries.insert(
+ std::map<TagKey, DictEntry>::value_type(tag, ent) );
+ entry = &(VirtualEntries.find(tag)->second);
+ }
+
+ return entry;