X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmSQItem.cxx;h=d7c29e5e4e0aa9fee103be946285f5729072a93f;hb=a0fbf995c51ba9e31cca7f14ba1deffdf188f3b9;hp=d308079d2099d4e6a5f98fb6a44743aba07a5f15;hpb=8a3dd7efbcb545e7ed308eb7334b1e6dbbf40923;p=gdcm.git diff --git a/src/gdcmSQItem.cxx b/src/gdcmSQItem.cxx index d308079d..d7c29e5e 100644 --- a/src/gdcmSQItem.cxx +++ b/src/gdcmSQItem.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSQItem.cxx,v $ Language: C++ - Date: $Date: 2004/10/25 03:35:20 $ - Version: $Revision: 1.31 $ + Date: $Date: 2004/11/04 15:08:50 $ + Version: $Revision: 1.35 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,7 +27,6 @@ namespace gdcm { - //----------------------------------------------------------------------------- // Constructor / Destructor /** @@ -49,7 +48,7 @@ SQItem::~SQItem() cc != DocEntries.end(); ++cc) { - delete (*cc); + delete *cc; } DocEntries.clear(); } @@ -70,7 +69,7 @@ SQItem::~SQItem() s << " | " ; } } - std::cout << s.str() << " --- SQItem number " << SQItemNumber << std::endl; + //std::cout << s.str() << " --- SQItem number " << SQItemNumber << std::endl; for (ListDocEntry::iterator i = DocEntries.begin(); i != DocEntries.end(); ++i) @@ -99,12 +98,16 @@ SQItem::~SQItem() */ void SQItem::Write(std::ofstream* fp, FileType filetype) { + int j; uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff }; uint16_t itemt[4]= { 0xfffe, 0xe00d, 0xffff, 0xffff }; //we force the writting of an 'Item' Start Element // because we want to write the Item as a 'no Length' item - fp->write((char*)&item[0],8); // fffe e000 ffff ffff + for(j=0;j<4;++j) + { + binary_write( *fp, item[j]); // fffe e000 ffff ffff + } for (ListDocEntry::iterator i = DocEntries.begin(); i != DocEntries.end(); @@ -130,8 +133,11 @@ void SQItem::Write(std::ofstream* fp, FileType filetype) //we force the writting of an 'Item Delimitation' item // because we wrote the Item as a 'no Length' item - fp->write((char*)&itemt[0],8); // fffe e000 ffff ffff - + for(j=0;j<4;++j) + { + binary_write( *fp, itemt[j]); // fffe e000 ffff ffff + } + } //----------------------------------------------------------------------------- @@ -185,13 +191,12 @@ bool SQItem::SetEntryByNumber(std::string const & val, uint16_t group, Dict *pubDict = Global::GetDicts()->GetDefaultPubDict(); // if the invoked (group,elem) doesn't exist inside the Dictionary // we create a VirtualDictEntry - DictEntry *dictEntry = pubDict->GetDictEntryByNumber(group, - element); + DictEntry *dictEntry = pubDict->GetDictEntryByNumber(group, element); if (dictEntry == NULL) { dictEntry = Global::GetDicts()->NewVirtualDictEntry(group, element, - "UN", "??", "??"); + "UN", "??", "??"); } // we assume the constructor didn't fail entry = new ValEntry(dictEntry);