[Dcmlib] new DicomDir syntax: aka Deprecation pass
Mathieu Malaterre
mathieu.malaterre at kitware.com
Wed Jul 13 21:50:05 CEST 2005
Luca,
Thanks for the info but I am rather looking for something like:
Visual Studio:
__declspec(deprecated) void foo() {}
or GCC:
void foo() __attribute__((deprecated)) {}
Is there such thing in borland ?
Thanks
Mathieu
Luca Picello wrote:
> Hi Mathieu,
> Borland compiler uses following syntax to produce compiler-warnings to
> use for deprecated functions.
>
> From Borland Help:
>
> The #pragma message compiler directive allows source code to emit
> warnings and errors just as the compiler does. Use #pragma message to
> specify a user-defined message within your program code, using one of
> the following formats.
> If you have a variable number of string constants, use:
>
> #pragma message( "hi there" )
>
> #pragma message( "hi" " there" )
>
> To write text following a message, use:
> #pragma message text
> To expand a previously defined value, use:
> #pragma message (text)
>
> #define text "a test string"
>
> #pragma message (text)
>
> For example, to display these messages on a button, use:
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
>
> {
> #pragma message( "hi there 1" )
> #pragma message( "hi " "there 2" )
> #pragma message hi there 3
> #define text "a test string"
> #pragma message (text)
> }
>
> To display the messages in the IDE, choose Projects|Options|Compiler,
> click the Compiler tab, and check the Show general messages check box.
>
>
>
>
> Mathieu Malaterre wrote:
>
>> Luca,
>>
>> Hum this is pretty bad. I thought the old functionanlities where
>> being kept back...
>> I would like then to introduce a deprecation mechanism that will
>> prevent event like this. A number of compilers (well in fact only
>> gcc/and visual studio but there are the main one), support a notion of
>> 'deprecated functions'. Therefore at *compiler* time the code produces
>> warning like:
>>
>> ..this function is deprecated...
>>
>> But the at run time the code still works ok.
>>
>>
>> JP can we keep the old API or is this too much troubles ? Is this
>> already broken ?
>>
>> Thanks,
>> Mathieu
>> Luca Picello wrote:
>>
>>> Hi all,
>>> Syncronizing with today's CVS my code is not working anymore.
>>> Its code is very easy and I wonder if you can help me on make it
>>> working again.
>>>
>>> gdcm::DicomDir *e1;
>>> gdcm::DicomDirPatient *pa;
>>>
>>> e1 = new gdcm::DicomDir( fold.c_str() , true ); // DEPRECATED OLD
>>> GDCM SYNTAX
>>>
>>> // NEW SYNTAX AS DESCRIBED IN ML BY JP:
>>> e1 = new gdcm::DicomDir();
>>> e1->SetDirectoryName(fold.c_str());
>>>
>>> ---
>>>
>>> if( e1->IsReadable() )
>>> or
>>> pa = e1->GetFirstPatient();
>>> now both fails!!
>>>
>>> I do have also access violation error doing (because of failure):
>>> delete e1;
>>>
>>> at: gdcmDicomDir.cxx at line 163 ( delete MetaElems; in
>>> DicomDir::~DicomDir() )
>>>
>>> thank you all,
>>> Luca
>>>
>>> ps: does anybody encoured my latest reported bug on halt on loading 2
>>> datasets?
>>> I can prepare a simple test when gdcm will be functional to me again...
>>>
>>>
>>> _______________________________________________
>>> Dcmlib mailing list
>>> Dcmlib at creatis.insa-lyon.fr
>>> http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib
>>>
>>
>> .
>>
>
> _______________________________________________
> Dcmlib mailing list
> Dcmlib at creatis.insa-lyon.fr
> http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib
>
More information about the Dcmlib
mailing list