+
+/**
+ * \ingroup DictSet
+ * \brief Retrieve the specified dictionary (when existing) from this
+ * DictSet.
+ * @param dictName The symbolic name of the searched dictionary.
+ * \result The retrieved dictionary.
+ */
+Dict *DictSet::GetDict(DictKey const & dictName)
+{
+ DictSetHT::iterator dict = Dicts.find(dictName);
+ if(dict != Dicts.end())
+ {
+ return dict->second;
+ }
+ return NULL;
+}
+
+/**
+ * \brief Create a DictEntry which will be reference
+ * in no dictionnary
+ * @return virtual entry
+ */
+DictEntry *DictSet::NewVirtualDictEntry( uint16_t group,
+ uint16_t element,
+ TagName vr,
+ TagName fourth,
+ TagName name)
+{
+ DictEntry *entry;
+ const std::string tag = DictEntry::TranslateToKey(group,element)
+ + "#" + vr + "#" + fourth + "#" + name;
+ TagKeyHT::iterator it;
+
+ it = VirtualEntry.find(tag);
+ if(it != VirtualEntry.end())
+ {
+ entry = &(it->second);
+ }
+ else
+ {
+ DictEntry ent(group, element, vr, fourth, name);
+ VirtualEntry.insert(
+ std::map<TagKey, DictEntry>::value_type
+ (tag, ent));
+ entry = &(VirtualEntry.find(tag)->second);
+ }
+
+ return entry;
+}
+
+/**
+ * \brief Obtain from the GDCM_DICT_PATH environnement variable the
+ * path to directory containing the dictionnaries. When
+ * the environnement variable is absent the path is defaulted
+ * to "../Dicts/".
+ * @return path to directory containing the dictionnaries
+ */
+std::string DictSet::BuildDictPath()
+{
+ std::string resultPath;
+ const char *envPath = 0;
+ envPath = getenv("GDCM_DICT_PATH");
+
+ if (envPath && (strlen(envPath) != 0))
+ {
+ resultPath = envPath;
+ if ( resultPath[resultPath.length()-1] != '/' )
+ {
+ resultPath += '/';
+ }
+ dbg.Verbose(1, "DictSet::BuildDictPath:",
+ "Dictionary path set from environnement");
+ }
+ else
+ {
+ resultPath = PUB_DICT_PATH;
+ }
+
+ return resultPath;
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+bool DictSet::AppendDict(Dict *newDict, DictKey const & name)
+{
+ Dicts[name] = newDict;
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+
+} // end namespace gdcm