-/**
- * \ingroup gdcmDictSet
- * \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/".
- */
-std::string gdcmDictSet::BuildDictPath(void) {
- std::string ResultPath;
- const char* EnvPath = (char*)0;
- EnvPath = getenv("GDCM_DICT_PATH");
- if (EnvPath && (strlen(EnvPath) != 0)) {
- ResultPath = EnvPath;
- if (ResultPath[ResultPath.length() -1] != '/' )
- ResultPath += '/';
- dbg.Verbose(1, "gdcmDictSet::BuildDictPath:",
- "Dictionary path set from environnement");
- } else
- ResultPath = PUB_DICT_PATH;
- return ResultPath;
-}
-
-/**
- * \ingroup gdcmDictSet
- * \brief The Dictionnary Set obtained with this constructor simply
- * contains the Default Public dictionnary.
- */
-gdcmDictSet::gdcmDictSet(void) {
- DictPath = BuildDictPath();
- std::string PubDictFile = DictPath + PUB_DICT_FILENAME;
- Dicts[PUB_DICT_NAME] = new gdcmDict(PubDictFile);
-}
-
-gdcmDictSet::~gdcmDictSet() {
- for (DictSetHT::iterator tag = Dicts.begin(); tag != Dicts.end(); ++tag) {
- gdcmDict* EntryToDelete = tag->second;
- if ( EntryToDelete )
- delete EntryToDelete;
- }
- Dicts.clear();
-}