OFFIS DCMTK  Version 3.6.0
dcpath.h
1 /*
2  *
3  * Copyright (C) 2008-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmdata
15  *
16  * Author: Michael Onken
17  *
18  * Purpose: Class declarations for accessing DICOM dataset structures (items,
19  * sequences and leaf elements via string-based path access.
20  *
21  * Last Update: $Author: joergr $
22  * Update Date: $Date: 2010-10-14 13:15:41 $
23  * CVS/RCS Revision: $Revision: 1.10 $
24  * Status: $State: Exp $
25  *
26  * CVS/RCS Log at end of file
27  *
28  */
29 
30 #ifndef DCPATH_H
31 #define DCPATH_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 
35 #include "dcmtk/dcmdata/dcdatset.h"
36 
37 
46 {
47 
48 public:
49 
52  DcmPathNode() : m_obj(NULL), m_itemNo(0) {}
53 
61  DcmPathNode(DcmObject* obj, Uint32 itemNo) : m_obj(obj), m_itemNo(itemNo) {}
62 
66 
69 
71  Uint32 m_itemNo;
72 
73 private:
74 
77  DcmPathNode(const DcmPathNode& rhs);
78 
81  DcmPathNode& operator=(const DcmPathNode& arg);
82 
83 };
84 
85 
94 class DcmPath
95 {
96 
97 public:
98 
101  DcmPath();
102 
107  DcmPath(const OFList<DcmPathNode*>& currentPath);
108 
114  void append(DcmPathNode* node);
115 
120  void deleteBackNode();
121 
125  OFListIterator(DcmPathNode*) begin();
126 
130  DcmPathNode* back();
131 
135  OFListIterator(DcmPathNode*) end();
136 
140  Uint32 size() const;
141 
145  OFBool empty() const;
146 
151  OFString toString() const;
152 
158  OFBool containsGroup(const Uint16& groupNo) const;
159 
168  static OFCondition separatePathNodes(const OFString& path, OFList<OFString>& result);
169 
183  static OFCondition parseItemNoFromPath(OFString& path, // inout
184  Uint32& itemNo, // out
185  OFBool& wasWildcard); // out
186 
196  static OFCondition parseTagFromPath(OFString& path, // inout
197  DcmTag& tag); // out
198 
204  ~DcmPath();
205 
206 private:
207 
210 
213  DcmPath(const DcmPath& rhs);
214 
217  DcmPath& operator=(const DcmPath& arg);
218 };
219 
220 
222 {
223 
224 public:
225 
229 
236  void setItemWildcardSupport(const OFBool& supported);
237 
238 
247  void checkPrivateReservations(const OFBool& doChecking);
248 
288  const OFString& path,
289  OFBool createIfNecessary = OFFalse);
290 
316  const OFString& path,
317  Uint32& numDeleted);
318 
326  Uint32 getResults(OFList<DcmPath*>& searchResults);
327 
328 
342  const OFString& overrideKey);
343 
348 
349 protected:
350 
385  OFString& path);
386 
420  OFString& path);
421 
433  static OFCondition deleteLastElemFromPath(DcmObject* objSearchedIn,
434  DcmPath *path,
435  DcmPathNode* toDelete);
436 
448  static OFCondition deleteLastItemFromPath(DcmObject* objSearchedIn,
449  DcmPath *path,
450  DcmPathNode* toDelete);
451 
462  DcmTag& tag);
469  static DcmTagKey calcPrivateReservationTag(const DcmTagKey &privateKey);
470 
479  void clear();
480 
481 private:
482 
485 
488 
492 
496 
500 
504 
508 
509 };
510 
511 
512 #endif // DCPATH_H
513 
514 /*
515 ** CVS/RCS Log:
516 ** $Log: dcpath.h,v $
517 ** Revision 1.10 2010-10-14 13:15:41 joergr
518 ** Updated copyright header. Added reference to COPYRIGHT file.
519 **
520 ** Revision 1.9 2010-08-09 13:02:56 joergr
521 ** Updated data dictionary to 2009 edition of the DICOM standard. From now on,
522 ** the official "keyword" is used for the attribute name which results in a
523 ** number of minor changes (e.g. "PatientsName" is now called "PatientName").
524 **
525 ** Revision 1.8 2009-11-04 09:58:07 uli
526 ** Switched to logging mechanism provided by the "new" oflog module
527 **
528 ** Revision 1.7 2009-09-29 12:55:17 uli
529 ** Include only the needed headers in dcpath.h and dcpath.cc
530 **
531 ** Revision 1.6 2009-07-10 13:12:30 onken
532 ** Added override key functionality used by tools like findscu to the more
533 ** central DcmPathProcessor class.
534 **
535 ** Revision 1.5 2009-07-08 16:09:30 onken
536 ** Cleaned up code for private reservation checking and added option for
537 ** disabling item wildcards for searching/creating tag paths.
538 **
539 ** Revision 1.4 2009-01-15 16:04:06 onken
540 ** Added options for handling of private tags and fixed bug for deleting
541 ** tags on main level.
542 **
543 ** Revision 1.3 2009-01-12 12:37:45 onken
544 ** Fixed iterators to also compile with STL classes being enabled.
545 **
546 ** Revision 1.2 2008-12-12 13:16:03 onken
547 ** Fixed doxygen documentation.
548 **
549 ** Revision 1.1 2008-12-12 11:44:40 onken
550 ** Moved path access functions to separate classes
551 **
552 */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2