Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

mdfdsman.h

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 and Datasets
00023  *
00024  *  Last Update:      $Author: onken $
00025  *  Update Date:      $Date: 2004/05/14 12:08:36 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/apps/mdfdsman.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.10 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 #ifndef MDFDSMAN_H
00035 #define MDFDSMAN_H
00036 
00037 #include "osconfig.h"   // make sure OS specific configuration is included first
00038 #include "dctagkey.h"
00039 #include "dcfilefo.h"
00040 #include "ofcond.h"
00041 #include "oflist.h"
00042 #include "dcvrat.h"
00043 //#include "dcdebug.h"
00044 
00049 class MdfDatasetManager
00050 {
00051 public:
00055     MdfDatasetManager(const OFBool debug);
00056 
00059     ~MdfDatasetManager();
00060 
00065     OFCondition loadFile(const char *file_name);
00066 
00074     OFCondition modifyOrInsertTag(OFString tag_path,
00075                                   const OFString &value,
00076                                   const OFBool &only_modify);
00077 
00084     OFCondition modifyAllTags(OFString tag_path,
00085                               const OFString &value,
00086                               int &count);
00087 
00094     OFCondition deleteTag(OFString tag_path,
00095                           const OFBool &all_tags);
00096 
00102     OFCondition saveFile(const char *file);
00103 
00107     OFCondition saveFile();
00108 
00115     DcmDataset* getDataset();
00116 
00117 
00124     DcmFileFormat* getFileFormat();
00125 
00129     OFString getFilename();
00130 
00137     static void debugMsg(const OFString &s1,
00138                          const OFString &s2,
00139                          const OFString &s3);
00140 
00141 protected:
00142 
00148     OFCondition startModify(DcmElement *elem, const OFString &value);
00149 
00156     OFCondition startInsert(DcmItem *item, DcmTagKey &search_key,
00157                             const OFString &value);
00158 
00160     OFString act_file;
00162     DcmFileFormat *dfile;
00164     DcmDataset *dset;
00166     OFBool debug_option;
00167 
00168 private:
00169 
00172     MdfDatasetManager &operator=(const MdfDatasetManager &);
00173 
00176     MdfDatasetManager(const MdfDatasetManager &);
00177 
00178 };
00179 
00180 #endif //MDFDSMAN_H
00181 
00182 /*
00183 ** CVS/RCS Log:
00184 ** $Log: mdfdsman.h,v $
00185 ** Revision 1.10  2004/05/14 12:08:36  onken
00186 ** Additional documentation added.
00187 **
00188 ** Revision 1.9  2004/04/19 14:45:07  onken
00189 ** Restructured code to avoid default parameter values for "complex types" like
00190 ** OFString. Required for Sun CC 2.0.1.
00191 **
00192 ** Revision 1.8  2003/12/17 17:07:22  onken
00193 ** MdfDatasetManager now remembers loaded filename. Additional save function
00194 ** added.
00195 **
00196 ** Revision 1.7  2003/12/10 16:19:20  onken
00197 ** Changed API of MdfDatasetManager, so that its transparent for user, whether
00198 ** he wants to modify itemtags or tags at 1. level.
00199 **
00200 ** Complete rewrite of MdfConsoleEngine. It doesn't support a batchfile any more,
00201 ** but now a user can give different modify-options at the same time on
00202 ** commandline. Other purifications and simplifications were made.
00203 **
00204 ** Revision 1.6  2003/11/11 10:55:51  onken
00205 ** - debug-mechanism doesn't use debug(..) any more
00206 ** - comments purified
00207 ** - headers adjustet to debug-modifications
00208 **
00209 ** Revision 1.5  2003/10/13 14:46:50  onken
00210 ** startModify(...) simplified (uses only putString to put element-values),
00211 ** this also allows now inserting and modifying of elements with VRM>1.
00212 ** Method getDataset() added.
00213 **
00214 ** Revision 1.4  2003/10/01 14:04:03  onken
00215 ** Corrected doxygen-information in headerfiles
00216 **
00217 ** Revision 1.3  2003/09/19 12:41:11  onken
00218 ** major bugfixes, new code structure, better error-handling, corrections for "dcmtk-coding-style",Handling of VR's corrected
00219 **
00220 ** Revision 1.2  2003/07/09 12:13:13  meichel
00221 ** Included dcmodify in MSVC build system, updated headers
00222 **
00223 ** Revision 1.1  2003/06/26 09:17:18  onken
00224 ** Added commandline-application dcmodify.
00225 **
00226 **
00227 */


Generated on 26 Apr 2005 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.4.2