GDCM
2.2.0
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 00005 Copyright (c) 2006-2011 Mathieu Malaterre 00006 All rights reserved. 00007 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 #ifndef GDCMSTRINGFILTER_H 00015 #define GDCMSTRINGFILTER_H 00016 00017 #include "gdcmDataElement.h" 00018 #include "gdcmDicts.h" 00019 #include "gdcmFile.h" 00020 00021 namespace gdcm 00022 { 00023 00029 class GDCM_EXPORT StringFilter 00030 { 00031 public: 00032 StringFilter(); 00033 ~StringFilter(); 00034 00036 void UseDictAlways(bool ) {} 00037 00039 void SetDicts(const Dicts &dicts); 00040 00042 std::string ToString(const Tag& t) const; 00043 00044 //std::string ToMime64(const Tag& t) const; 00045 00050 std::pair<std::string, std::string> ToStringPair(const Tag& t) const; 00051 00053 std::string FromString(const Tag&t, const char * value, VL const & vl); 00054 00055 // Use this one 00056 std::string FromString(const Tag&t, const char * value, size_t len); 00057 00058 //typedef std::map<Tag, gdcm::ConstCharWrapper> StringSet; 00059 00061 void SetFile(const File& f) { F = f; } 00062 File &GetFile() { return *F; } 00063 const File &GetFile() const { return *F; } 00064 00068 bool ExecuteQuery(std::string const &query, std::string & value) const; 00069 00070 protected: 00071 std::pair<std::string, std::string> ToStringPair(const Tag& t, DataSet const &ds) const; 00072 bool ExecuteQuery(std::string const &query, DataSet const &ds, std::string & value) const; 00073 00074 private: 00075 SmartPointer<File> F; 00076 }; 00077 00078 } // end namespace gdcm 00079 00080 #endif //GDCMSTRINGFILTER_H