-#include "gdcm.h"
-#include "gdcmUtil.h"
-
-#define PUB_DICT_NAME "DicomV3Dict"
-#define PUB_DICT_PATH "../Dicts/"
-#define PUB_DICT_FILENAME "dicomV3.dic"
-
-gdcmDictSet::gdcmDictSet(void) {
- SetDictPath();
- if (! LoadDicomV3Dict())
- return;
-}
-
-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;
+
+namespace gdcm
+{
+
+//-----------------------------------------------------------------------------
+// Constructor / Destructor
+/**
+ * \ingroup DictSet
+ * \brief The Dictionnary Set obtained with this constructor simply
+ * contains the Default Public dictionnary.
+ */
+DictSet::DictSet()
+{
+ DictPath = BuildDictPath();
+ std::string pubDictFile(DictPath);
+ pubDictFile += PUB_DICT_FILENAME;
+ Dicts[PUB_DICT_NAME] = new Dict(pubDictFile);
+}
+
+/**
+ * \ingroup DictSet
+ * \brief Destructor
+ */
+DictSet::~DictSet()
+{
+ // Remove dictionnaries
+ for (DictSetHT::iterator tag = Dicts.begin(); tag != Dicts.end(); ++tag)
+ {
+ Dict *entryToDelete = tag->second;
+ if ( entryToDelete )
+ {
+ delete entryToDelete;
+ }
+ tag->second = NULL;
+ }
+ Dicts.clear();
+
+ // Remove virtual dictionnary entries
+ VirtualEntry.clear();
+}
+
+//-----------------------------------------------------------------------------
+// Print
+/**
+ * \ingroup DictSet
+ * \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.
+ */
+void DictSet::Print(std::ostream& os)
+{
+ for (DictSetHT::iterator dict = Dicts.begin(); dict != Dicts.end(); ++dict)
+ {
+ os << "Printing dictionary " << dict->first << std::endl;
+ dict->second->Print(os);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// Public
+/**
+ * \ingroup DictSet
+ * \brief Consider all the entries of the public dicom dictionnary.
+ * Build all list of all the tag names of all those entries.
+ * \sa DictSet::GetPubDictTagNamesByCategory
+ * @return A list of all entries of the public dicom dictionnary.
+ */
+EntryNamesList * DictSet::GetPubDictEntryNames()
+{
+ return GetDefaultPubDict()->GetDictEntryNames();