# gdcmStringFilter.h

Go to the documentation of this file.

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