DCMTK: ofstd: a library of general purpose classes

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
ofstd: a library of general purpose classes

This module contains general purpose classes which are not specific to the DICOM standard. They are used extensively throughout the toolkit.

The main classes are (in alphabetical order):

- OFCommandLine
- OFCondition
- OFFile
- OFList
- OFStack
- OFStandard
- OFString
- OFVector

Here are some further utilities that may be of interest:

- OFCharacterEncoding
- OFConsole
- OFConsoleApplication
- OFDate
- OFDateTime
- OFdirectory_iterator
- OFerror_code
- OFMap
- OFoptional
- OFpath
- OFshared_ptr
- OFstatic_assert
- OFThread
- OFTime
- OFtuple
- OFunique_ptr
- OFvariant

# Testing

This module also contains a simple test framework.

New tests can be written with the OF_TEST macro and checks can be implemented with the OF_CHECK, OF_CHECK_EQUAL and OF_FAIL macros. Each test then has to be registered with OF_TEST_REGISTER() in a source file calling OF_TEST_MAIN("name_of_module")

Here is an example which uses all these macros:

OF_TEST(ofstd_Example)
{
// If possible, use this. In case of errors, the error message
// will contain both values.
OF_CHECK_EQUAL(1, 2);
// The error message here will just say that "1 == 2" failed. If you are
// comparing variables, the values will be unknown.
OF_CHECK(1 == 2);
// This just prints a message of your choice.
if (1 != 2)
OF_FAIL("1 does not equal 2");
}

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2