MdfConsoleEngine Class Reference

This class encapsulates data structures and operations for modifying Dicom files from the commandline. More...

List of all members.

Public Member Functions

 MdfConsoleEngine (int argc, char *argv[], const char *appl_name)
 Constructor.
 ~MdfConsoleEngine ()
 Destructor.
int startProvidingService ()
 This function looks at commandline options and decides what to do.

Protected Member Functions

void parseNonJobOptions ()
 Checks for non-job commandline options like --debug etc.
void parseCommandLine ()
 Parses commandline options into corresponding file- and job lists and enables debug/verbose mode.
void splitPathAndValue (const OFString &whole, OFString &path, OFString &value)
 This function splits a modify option (inclusive value) as found on commandline into to parts (path and value) e.g.
int executeJob (const MdfJob &job)
 Executes given modify job.
OFCondition loadFile (const char *filename)
 Backup and load file into internal MdfDatasetManager.
OFCondition backupFile (const char *file_name)
 Backup given file from file to file.bak.
OFCondition restoreFile (const char *filename)
 Restore given file from file.bak to original (without .bak).
void debugMsg (const OFBool &condition, const OFString &s1, const OFString &s2, const OFString &s3)
 The function handles three strings, that are directly printed after another.

Protected Attributes

OFConsoleApplicationapp
 helper class for console applications
OFCommandLinecmd
 helper class for commandline parsing
MdfDatasetManagerds_man
 ds_man holds dataset manager, that is used for modify operations
OFBool verbose_option
 verbose mode
OFBool debug_option
 debug mode
OFBool ignore_errors_option
 ignore errors option
OFBool update_metaheader_uids_option
E_FileReadMode read_mode_option
 read file with or without metaheader
E_TransferSyntax input_xfer_option
 denotes the expected transfersyntax
OFBool output_dataset_option
 decides whether to with/without metaheader
E_TransferSyntax output_xfer_option
 denotes the transfer syntax that should be written
E_GrpLenEncoding glenc_option
 option for group length recalcing
E_EncodingType enctype_option
 write explicit or implicit length encoding
E_PaddingEncoding padenc_option
 padding output
OFCmdUnsignedInt filepad_option
 internal padding variables
OFCmdUnsignedInt itempad_option
OFList< MdfJob > * jobs
 list of jobs to be executed
OFList< OFString > * files
 list of files to be modified

Private Member Functions

MdfConsoleEngineoperator= (const MdfConsoleEngine &)
 private undefined assignment operator
 MdfConsoleEngine (const MdfConsoleEngine &)
 private undefined copy constructor


Detailed Description

This class encapsulates data structures and operations for modifying Dicom files from the commandline.

Definition at line 69 of file mdfconen.h.


Constructor & Destructor Documentation

MdfConsoleEngine::MdfConsoleEngine int  argc,
char *  argv[],
const char *  appl_name
 

Constructor.

Parameters:
argc Number of commandline arguments
argv Array holding the commandline arguments
appl_name Name of calling application, that instantiates this class


Member Function Documentation

OFCondition MdfConsoleEngine::backupFile const char *  file_name  )  [protected]
 

Backup given file from file to file.bak.

Parameters:
file_name filename of file, that should be backuped
Returns:
OFCondition, whether backup was successful or not

void MdfConsoleEngine::debugMsg const OFBool &  condition,
const OFString s1,
const OFString s2,
const OFString s3
[protected]
 

The function handles three strings, that are directly printed after another.

The whole message is then terminated by

Parameters:
condition message is printed, if condition is true
s1 first message string
s2 second message string
s2 third message string

int MdfConsoleEngine::executeJob const MdfJob job  )  [protected]
 

Executes given modify job.

Parameters:
job job to be executed
Returns:
returns 0 if no error occured, else the number of errors

OFCondition MdfConsoleEngine::loadFile const char *  filename  )  [protected]
 

Backup and load file into internal MdfDatasetManager.

Parameters:
filename name of file to load
Returns:
OFCondition, whether loading/backuping was successful including error description

void MdfConsoleEngine::parseCommandLine  )  [protected]
 

Parses commandline options into corresponding file- and job lists and enables debug/verbose mode.

The joblist is built in order of modify options on commandline

void MdfConsoleEngine::parseNonJobOptions  )  [protected]
 

Checks for non-job commandline options like --debug etc.

and sets corresponding internal flags

OFCondition MdfConsoleEngine::restoreFile const char *  filename  )  [protected]
 

Restore given file from file.bak to original (without .bak).

Parameters:
restore "filename".bak to original without .bak
Returns:
OFCondition, whether restoring was successful

void MdfConsoleEngine::splitPathAndValue const OFString whole,
OFString path,
OFString value
[protected]
 

This function splits a modify option (inclusive value) as found on commandline into to parts (path and value) e.g.

"(0010,0010)=value" into path "(0010,0010)" and "value"

Parameters:
string to be splitted
path returns part containing the path
value returns part containing the value(if theres one)

int MdfConsoleEngine::startProvidingService  ) 
 

This function looks at commandline options and decides what to do.

It evaluates option values from commandline and prepares them for starting the corresponding private functions.

Returns:
Returns 0 if successful, another value if errors occurreds


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


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5