+
+/**
+ * \brief Obtain from the GDCM_DICT_PATH environnement variable the
+ * path to directory containing the dictionaries. When
+ * the environnement variable is absent the path is defaulted
+ * to "../Dicts/".
+ * @return path to directory containing the dictionaries
+ */
+std::string DictSet::BuildDictPath()
+{
+ std::string resultPath;
+ const char *envPath;
+ envPath = getenv("GDCM_DICT_PATH");
+
+ if (envPath && (strlen(envPath) != 0))
+ {
+ resultPath = envPath;
+ gdcmWarningMacro( "Dictionary path set from environnement");
+ }
+ else
+ {
+ resultPath = PUB_DICT_PATH;
+ }
+ if ( resultPath[resultPath.length()-1] != '/' )
+ {
+ resultPath += '/';
+ }
+
+ return resultPath;
+}
+
+//-----------------------------------------------------------------------------
+// Protected
+/**
+ * \brief Adds a Dictionary to a DictSet
+ * \return always true
+ */
+bool DictSet::AppendDict(Dict *newDict, DictKey const &name)
+{
+ Dicts[name] = newDict;
+
+ return true;
+}
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \brief Print, in an informal fashion, the list of all the dictionaries
+ * contained is this DictSet, along with their respective content.
+ * @param os Output stream used for printing.
+ * @param indent Indentation string to be prepended during printing
+ */
+void DictSet::Print(std::ostream &os, std::string const & )
+{
+ for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
+ {
+ os << "Printing dictionary " << dict->first << std::endl;
+ dict->second->Print(os);
+ }
+}
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm