-/*
- * \brief Modifies the value of a given Header Entry (Dicom Element)
- * when it exists. Create it with the given value when unexistant.
- * @param voidArea (binary) value to be set
- * @param Group Group number of the Entry
- * @param Elem Element number of the Entry
- * \return pointer to the modified/created Header Entry (NULL when creation
- * failed).
- */
-gdcmBinEntry * gdcmDocument::ReplaceOrCreateByNumber(
- void *voidArea,
- int lgth,
- uint16_t group,
- uint16_t elem)
-{
- gdcmBinEntry* b = 0;
- gdcmDocEntry* a = GetDocEntryByNumber( group, elem);
- if (!a)
- {
- a = NewBinEntryByNumber(group, elem);
- if (!a)
- {
- return 0;
- }
-
- b = new gdcmBinEntry(a);
- AddEntry(b);
- b->SetVoidArea(voidArea);
- }
- SetEntryByNumber(voidArea, lgth, group, elem);
- //b->SetVoidArea(voidArea); //what if b == 0 !!
-
- return b;
-}
-
-
-/*
- * \brief Modifies the value of a given Header Entry (Dicom Element)
- * when it exists. Create it when unexistant.
- * @param Group Group number of the Entry
- * @param Elem Element number of the Entry
- * \return pointer to the modified/created SeqEntry (NULL when creation
- * failed).
- */
-gdcmSeqEntry * gdcmDocument::ReplaceOrCreateByNumber(
- uint16_t group,
- uint16_t elem)
-{
- gdcmSeqEntry* b = 0;
- gdcmDocEntry* a = GetDocEntryByNumber( group, elem);
- if (!a)
- {
- a = NewSeqEntryByNumber(group, elem);
- if (!a)
- {
- return 0;
- }
-
- b = new gdcmSeqEntry(a, 1); // FIXME : 1 (Depth)
- AddEntry(b);
- }
- return b;
-}
-
-/**
- * \brief Set a new value if the invoked element exists
- * Seems to be useless !!!
- * @param value new element value
- * @param group group number of the Entry
- * @param elem element number of the Entry
- * \return boolean
- */
-bool gdcmDocument::ReplaceIfExistByNumber(std::string const & value,
- uint16_t group, uint16_t elem )
-{
- SetEntryByNumber(value, group, elem);
-
- return true;
-}
-
-//-----------------------------------------------------------------------------
-// Protected
-
-/**
- * \brief Checks if a given Dicom Element exists within the H table
- * @param group Group number of the searched Dicom Element
- * @param element Element number of the searched Dicom Element
- * @return true is found
- */
-bool gdcmDocument::CheckIfEntryExistByNumber(uint16_t group, uint16_t element )
-{
- const std::string &key = gdcmDictEntry::TranslateToKey(group, element );
- return TagHT.count(key);
-}
-
-/**
- * \brief Searches within Header Entries (Dicom Elements) parsed with
- * the public and private dictionaries
- * for the element value of a given tag.
- * \warning Don't use any longer : use GetPubEntryByName
- * @param tagName name of the searched element.
- * @return Corresponding element value when it exists,
- * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
- */
-std::string gdcmDocument::GetEntryByName(TagName const & tagName)
-{
- gdcmDictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName);
- if( !dictEntry )
- {
- return GDCM_UNFOUND;
- }
-
- return GetEntryByNumber(dictEntry->GetGroup(),dictEntry->GetElement());
-}
-
-/**
- * \brief Searches within Header Entries (Dicom Elements) parsed with
- * the public and private dictionaries
- * for the element value representation of a given tag.
- *
- * Obtaining the VR (Value Representation) might be needed by caller
- * to convert the string typed content to caller's native type
- * (think of C++ vs Python). The VR is actually of a higher level
- * of semantics than just the native C++ type.
- * @param tagName name of the searched element.
- * @return Corresponding element value representation when it exists,
- * and the string GDCM_UNFOUND ("gdcm::Unfound") otherwise.
- */
-std::string gdcmDocument::GetEntryVRByName(TagName const & tagName)
-{
- gdcmDictEntry *dictEntry = RefPubDict->GetDictEntryByName(tagName);
- if( dictEntry == NULL)
- {
- return GDCM_UNFOUND;
- }
-
- gdcmDocEntry* elem = GetDocEntryByNumber(dictEntry->GetGroup(),
- dictEntry->GetElement());
- return elem->GetVR();