00001 /* 00002 * 00003 * Copyright (C) 2003, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmdata 00019 * 00020 * Author: Michael Onken 00021 * 00022 * Purpose: Class for modifying DICOM-Files from comandline 00023 * 00024 * Last Update: $Author: onken $ 00025 * Update Date: $Date: 2004/04/19 14:45:07 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/apps/mdfconen.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.8 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef MDFCONEN_H 00035 #define MDFCONEN_H 00036 00037 #include "osconfig.h" // make sure OS specific configuration is included first 00038 #include "mdfdsman.h" 00039 #include "oftypes.h" 00040 #include "ofconapp.h" 00041 #include "oflist.h" 00042 #include "ofcond.h" 00043 #include "dctagkey.h" 00044 00047 class MdfJob { 00048 00049 public : 00050 00051 OFString option; 00052 OFString path; 00053 OFString value; 00054 00057 OFBool operator==(const MdfJob& j) const; 00058 00059 private : 00060 00063 MdfJob &operator=(const MdfJob& j); 00064 }; 00065 00066 00070 class MdfConsoleEngine 00071 { 00072 public: 00073 00080 MdfConsoleEngine(int argc, char *argv[], 00081 const char* appl_name); 00082 00085 ~MdfConsoleEngine(); 00086 00092 int startProvidingService(); 00093 00094 protected: 00096 OFConsoleApplication *app; 00098 OFCommandLine *cmd; 00100 MdfDatasetManager *ds_man; 00102 OFBool verbose_option; 00104 OFBool debug_option; 00106 OFBool ignore_errors_option; 00108 OFList<MdfJob> *jobs; 00110 OFList<OFString> *files; 00111 00119 void splitPathAndValue(const OFString &whole, 00120 OFString &path, 00121 OFString &value); 00122 00127 int executeJob(const MdfJob &job); 00128 00133 void parseCommandLine(); 00134 00140 OFCondition loadFile(const char* filename); 00141 00146 OFCondition backupFile(const char *file_name); 00147 00152 OFCondition restoreFile(const char *filename); 00153 00154 private: 00155 00158 MdfConsoleEngine &operator=(const MdfConsoleEngine &); 00159 00162 MdfConsoleEngine(const MdfConsoleEngine &); 00163 00164 }; 00165 00166 #endif //MDFCONEN_H 00167 00168 /* 00169 ** CVS/RCS Log: 00170 ** $Log: mdfconen.h,v $ 00171 ** Revision 1.8 2004/04/19 14:45:07 onken 00172 ** Restructured code to avoid default parameter values for "complex types" like 00173 ** OFString. Required for Sun CC 2.0.1. 00174 ** 00175 ** Revision 1.7 2003/12/10 16:19:20 onken 00176 ** Changed API of MdfDatasetManager, so that its transparent for user, whether 00177 ** he wants to modify itemtags or tags at 1. level. 00178 ** 00179 ** Complete rewrite of MdfConsoleEngine. It doesn't support a batchfile any more, 00180 ** but now a user can give different modify-options at the same time on 00181 ** commandline. Other purifications and simplifications were made. 00182 ** 00183 ** Revision 1.6 2003/11/11 10:55:51 onken 00184 ** - debug-mechanism doesn't use debug(..) any more 00185 ** - comments purified 00186 ** - headers adjustet to debug-modifications 00187 ** 00188 ** Revision 1.5 2003/10/13 14:51:49 onken 00189 ** improved backup-strategy 00190 ** 00191 ** Revision 1.4 2003/10/01 14:04:03 onken 00192 ** Corrected doxygen-information in headerfiles 00193 ** 00194 ** Revision 1.3 2003/09/19 12:43:54 onken 00195 ** major bug fixes, corrections for "dcmtk-coding-style", better error-handling 00196 ** 00197 ** Revision 1.2 2003/07/09 12:13:13 meichel 00198 ** Included dcmodify in MSVC build system, updated headers 00199 ** 00200 ** Revision 1.1 2003/06/26 09:17:18 onken 00201 ** Added commandline-application dcmodify. 00202 ** 00203 ** 00204 */