API bug - DcmTag::getTagName ()

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
mlfarrell
Posts: 10
Joined: Wed, 2009-10-28, 21:59

API bug - DcmTag::getTagName ()

#1 Post by mlfarrell »

API bug - DcmTag::getTagName () needs to have a constant qualifier

Otherwise, I'm stuck.

ie:

Code: Select all

      for(int i = 0; ; i++)  
      {
        cout << i << endl;
        DcmElement *el = dfile->getDataset()->getElement(i);
        if(el->getOFStringArray(vstr).bad())
          break;
        dstr = el->getTag().getTagName();
        
        cout << vstr << endl;
        
        gtk_list_store_append(store, &iter);
        gtk_list_store_set(store, &iter,
                            COL_DESCR, dstr.c_str(),
                            COL_VALUE, vstr.c_str(),
                            -1);        
      }
kicks out with
../../src/data_window.cpp:66:0 ../../src/data_window.cpp:66: error: passing 'const DcmTag' as 'this' argument of 'const char* DcmTag::getTagName()' discards qualifiers

Also, is there a workaround so I don't have to recompile the lib for all three OS's that I'm using?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

I don't think that this is a bug. The method is not "const" since a lookup in the data dictionary might be performed (if not already done). Btw, why don't you use the method getTagName() on the DcmElement instance?

martinrame
Posts: 347
Joined: Mon, 2009-02-23, 19:57

#3 Post by martinrame »

Jörg, the method getTagName() of DcmElement is protected.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Sorry, you are right. So, please forget the last sentence of my above posting :-)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest