Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMSORTER_H
00016 #define GDCMSORTER_H
00017
00018 #include "gdcmDirectory.h"
00019 #include "gdcmTag.h"
00020
00021 #include <vector>
00022 #include <string>
00023 #include <map>
00024
00025 namespace gdcm
00026 {
00027 class DataSet;
00028
00039 class GDCM_EXPORT Sorter
00040 {
00041 friend std::ostream& operator<<(std::ostream &_os, const Sorter &s);
00042 public:
00043 Sorter();
00044 virtual ~Sorter();
00045
00047 virtual bool Sort(std::vector<std::string> const & filenames);
00048
00051 const std::vector<std::string> &GetFilenames() const { return Filenames; }
00052
00054 void Print(std::ostream &os) const;
00055
00057 bool AddSelect( Tag const &tag, const char *value );
00058
00060 typedef bool (*SortFunction)(DataSet const &, DataSet const &);
00061 void SetSortFunction( SortFunction f );
00062
00063 virtual bool StableSort(std::vector<std::string> const & filenames);
00064
00065 protected:
00066 std::vector<std::string> Filenames;
00067 typedef std::map<Tag,std::string> SelectionMap;
00068 std::map<Tag,std::string> Selection;
00069 SortFunction SortFunc;
00070 };
00071
00072 inline std::ostream& operator<<(std::ostream &os, const Sorter &s)
00073 {
00074 s.Print( os );
00075 return os;
00076 }
00077
00078
00079 }
00080
00081 #endif //GDCMSORTER_H