00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef DCPATH_H
00031 #define DCPATH_H
00032
00033 #include "dcmtk/config/osconfig.h"
00034
00035 #include "dcmtk/dcmdata/dcdatset.h"
00036
00037
00045 class DcmPathNode
00046 {
00047
00048 public:
00049
00052 DcmPathNode() : m_obj(NULL), m_itemNo(0) {}
00053
00061 DcmPathNode(DcmObject* obj, Uint32 itemNo) : m_obj(obj), m_itemNo(itemNo) {}
00062
00065 ~DcmPathNode() { }
00066
00068 DcmObject* m_obj;
00069
00071 Uint32 m_itemNo;
00072
00073 private:
00074
00077 DcmPathNode(const DcmPathNode& rhs);
00078
00081 DcmPathNode& operator=(const DcmPathNode& arg);
00082
00083 };
00084
00085
00094 class DcmPath
00095 {
00096
00097 public:
00098
00101 DcmPath();
00102
00107 DcmPath(const OFList<DcmPathNode*>& currentPath);
00108
00114 void append(DcmPathNode* node);
00115
00120 void deleteBackNode();
00121
00125 OFListIterator(DcmPathNode*) begin();
00126
00130 DcmPathNode* back();
00131
00135 OFListIterator(DcmPathNode*) end();
00136
00140 Uint32 size() const;
00141
00145 OFBool empty() const;
00146
00151 OFString toString() const;
00152
00158 OFBool containsGroup(const Uint16& groupNo) const;
00159
00168 static OFCondition separatePathNodes(const OFString& path, OFList<OFString>& result);
00169
00183 static OFCondition parseItemNoFromPath(OFString& path,
00184 Uint32& itemNo,
00185 OFBool& wasWildcard);
00186
00196 static OFCondition parseTagFromPath(OFString& path,
00197 DcmTag& tag);
00198
00204 ~DcmPath();
00205
00206 private:
00207
00209 OFList<DcmPathNode*> m_path;
00210
00213 DcmPath(const DcmPath& rhs);
00214
00217 DcmPath& operator=(const DcmPath& arg);
00218 };
00219
00220
00221 class DcmPathProcessor
00222 {
00223
00224 public:
00225
00228 DcmPathProcessor();
00229
00236 void setItemWildcardSupport(const OFBool& supported);
00237
00238
00247 void checkPrivateReservations(const OFBool& doChecking);
00248
00287 OFCondition findOrCreatePath(DcmObject* obj,
00288 const OFString& path,
00289 OFBool createIfNecessary = OFFalse);
00290
00315 OFCondition findOrDeletePath(DcmObject* obj,
00316 const OFString& path,
00317 Uint32& numDeleted);
00318
00326 Uint32 getResults(OFList<DcmPath*>& searchResults);
00327
00328
00341 OFCondition applyPathWithValue(DcmDataset *dataset,
00342 const OFString& overrideKey);
00343
00347 ~DcmPathProcessor();
00348
00349 protected:
00350
00384 OFCondition findOrCreateItemPath(DcmItem* item,
00385 OFString& path);
00386
00419 OFCondition findOrCreateSequencePath(DcmSequenceOfItems* seq,
00420 OFString& path);
00421
00433 static OFCondition deleteLastElemFromPath(DcmObject* objSearchedIn,
00434 DcmPath *path,
00435 DcmPathNode* toDelete);
00436
00448 static OFCondition deleteLastItemFromPath(DcmObject* objSearchedIn,
00449 DcmPath *path,
00450 DcmPathNode* toDelete);
00451
00461 OFCondition checkPrivateTagReservation(DcmItem *item,
00462 DcmTag& tag);
00469 static DcmTagKey calcPrivateReservationTag(const DcmTagKey &privateKey);
00470
00479 void clear();
00480
00481 private:
00482
00484 OFList<DcmPathNode*> m_currentPath;
00485
00487 OFList<DcmPath*> m_results;
00488
00491 OFBool m_createIfNecessary;
00492
00495 OFBool m_checkPrivateReservations;
00496
00499 OFBool m_itemWildcardsEnabled;
00500
00503 DcmPathProcessor(const DcmPathProcessor& rhs);
00504
00507 DcmPathProcessor& operator=(const DcmPathProcessor& arg);
00508
00509 };
00510
00511
00512 #endif // DCPATH_H
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552