DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Member Functions | Private Attributes | List of all members
OFConfigFileCursor Class Reference

structure used by class OFConfigFile to store a cursor pointing to the currently selected section and entry in the config data More...

## Public Member Functions
| OFConfigFileCursor (unsigned int maxLevel)
| default constructor
| OFConfigFileCursor (const OFConfigFileCursor &source)
| copy constructor
| ~OFConfigFileCursor ()
| destructor
OFConfigFileCursor & | operator= (const OFConfigFileCursor &source)
| assignment operator
void | clear ()
| return object to default constructed state (invalid cursor)
const char * | getKeyword (unsigned int level) const
| return keyword as C string. More...
const char * | getValue (unsigned int level) const
| return value as C string Precondition is that section_valid(level) return true. More...
OFBool | section_valid (unsigned int level) const
| checks if the cursor points to a valid location up to the given level More...
void | set_section (unsigned int level, const char *key, OFConfigFileNode *anchor)
| sets cursor to the entry with keyword "key" at the given level. More...
void | first_section (unsigned int level, OFConfigFileNode *anchor)
| sets cursor to the first entry at the given level (without changing the cursor position at higher levels). More...
void | next_section (unsigned int level)
| sets cursor to the next entry at the given level (without changing the cursor position at higher levels). More...
void | insert (unsigned int level, OFConfigFileNode *&newnode, OFConfigFileNode *&anchor, OFBool orderedMode)
| inserts a new node into the tree at the current cursor position More...
OFBool | operator< (const OFConfigFileCursor &) const
| dummy comparison operator, needed by MSVC5 with STL. More...
OFBool | operator== (const OFConfigFileCursor &) const
| dummy comparison operator, needed by MSVC5 with STL. More...

## Private Member Functions
void | orderedInsert (OFConfigFileNode *parent, OFConfigFileNode *&newnode)
| helper method that is called by insert() in ordered mode to insert a new node at a given tree level (i.e. More...

## Private Attributes
OFConfigFileNodePtr * | array_
| the cursor is an array of pointers to OFConfigFileNode objects
unsigned int | maxLevel_
| depth of tree, i.e. number of entries in array_

## Detailed Description

structure used by class OFConfigFile to store a cursor pointing to the currently selected section and entry in the config data

## Member Function Documentation

## ◆ first_section()

void OFConfigFileCursor::first_section | ( | unsigned int | level,
|  | OFConfigFileNode * | anchor
| ) |  |

sets cursor to the first entry at the given level (without changing the cursor position at higher levels).

Cursor must be valid at the level higher than the one specified. If no section is found the cursor becomes invalid at the specified level. The cursor always becomes invalid at all levels lower than specified.

Parameters

  level | cursor level
  anchor | pointer to anchor node in config tree

## ◆ getKeyword()

const char* OFConfigFileCursor::getKeyword | ( | unsigned int | level | ) | const
| inline

return keyword as C string.

Precondition is that section_valid(level) return true.

Parameters

  level | cursor level

## ◆ getValue()

const char* OFConfigFileCursor::getValue | ( | unsigned int | level | ) | const
| inline

return value as C string Precondition is that section_valid(level) return true.

Parameters

  level | cursor level

## ◆ insert()

void OFConfigFileCursor::insert | ( | unsigned int | level,
|  | OFConfigFileNode *& | newnode,
|  | OFConfigFileNode *& | anchor,
|  | OFBool | orderedMode
| ) |  |

inserts a new node into the tree at the current cursor position

Parameters

  level | level of insertion
  newnode | node to be inserted, must not be NULL
  anchor | pointer to anchor node of tree, may be modified
  orderedMode | mode flag for processing configuration files. See documentation of OFConfigFile::orderedMode_

## ◆ next_section()

void OFConfigFileCursor::next_section | ( | unsigned int | level | ) |

sets cursor to the next entry at the given level (without changing the cursor position at higher levels).

Cursor must be valid at the level specified. If no section is found the cursor becomes invalid at the specified level. The cursor always becomes invalid at all levels lower than specified.

Parameters

  level | cursor level

## ◆ operator<()

OFBool OFConfigFileCursor::operator< | ( | const OFConfigFileCursor & |  | ) | const
| inline

dummy comparison operator, needed by MSVC5 with STL.

Returns
  always false

## ◆ operator==()

OFBool OFConfigFileCursor::operator== | ( | const OFConfigFileCursor & |  | ) | const
| inline

dummy comparison operator, needed by MSVC5 with STL.

Returns
  always true

## ◆ orderedInsert()

void OFConfigFileCursor::orderedInsert | ( | OFConfigFileNode * | parent,
|  | OFConfigFileNode *& | newnode
| ) |  |
| private

helper method that is called by insert() in ordered mode to insert a new node at a given tree level (i.e.

within a list of nodes that share the same parent node) in alphabetical order, replacing any older node with identical keyword.

Parameters

  parent | parent node of new new to be inserted
  newnode | pointer to new node to be inserted

## ◆ section_valid()

OFBool OFConfigFileCursor::section_valid | ( | unsigned int | level | ) | const

checks if the cursor points to a valid location up to the given level

Parameters

  level | cursor level

Returns
  true if valid, false otherwise

## ◆ set_section()

void OFConfigFileCursor::set_section | ( | unsigned int | level,
|  | const char * | key,
|  | OFConfigFileNode * | anchor
| ) |  |

sets cursor to the entry with keyword "key" at the given level.

Cursor must be valid at the level higher than the one specified. If the keyword exists more than once, the first occurrence is found. If the keyword does not exist, the cursor becomes invalid at the specified level. The cursor always becomes invalid at all levels lower than specified.

Parameters

  level | cursor level
  key | key value
  anchor | pointer to anchor node in config tree

The documentation for this class was generated from the following file:

- ofstd/include/dcmtk/ofstd/ofconfig.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1