00001 #ifndef DDSFILEHANDLER_H
00002 #define DDSFILEHANDLER_H
00003
00005
00006
00007
00008
00009
00010
00011
00012
00013
00015 #include <iosfwd>
00016 #include <vector>
00017
00018 #include "Dispatcher/DDS.h"
00019
00020 class DDSFileHandler;
00021
00022 std::ostream& operator << (std::ostream& ms, DDSFileHandler* dfh);
00023
00024 class DDSFileHandler {
00025
00026 public:
00027
00028 typedef std::vector<std::string> FileIndex;
00029 typedef FileIndex::iterator FileIndexItr;
00030 typedef FileIndex::const_iterator FileIndexConstItr;
00031
00032
00033 DDSFileHandler (DDS::EDataSource datasource,bool offLine = false);
00034 virtual ~DDSFileHandler ();
00035
00036
00037 std::string GetCurrentFileName() const;
00038 DDS::EDataSource GetDataSource() const { return fDataSource; }
00039 std::string GetSymLinkTargetName();
00040 bool IsOffLine() const { return fOffLine; }
00041 bool IsValid() const { return fValid; }
00042 bool NewFileAvailable();
00043 std::ostream& Print(std::ostream& ms) const;
00044
00045
00046 std::string GoToFile(std::string filename="");
00047 std::string GoToNextFile();
00048 std::string GoToSymLinkFile();
00049
00050 private:
00051
00052
00053 bool IsModifiedDirectory() const;
00054 bool IsModifiedSymLink() const;
00055
00056
00057 Int_t BuildFileIndex();
00058 std::string BuildFullFilePathName(std::string filename);
00059
00060
00061 DDS::EDataSource fDataSource;
00062 std::string fDataSourceEnv;
00063 std::string fDataSourceDir;
00064 std::string fLocalDataSourceDir;
00065 std::string fSymLink;
00066 std::string fSymLinkTarget;
00067 Long_t fSymLinkModTime;
00068 Long_t fSourceDirModTime;
00069 std::string fLastServedFile;
00070 bool fValid;
00071 FileIndex fFileIndex;
00072 FileIndexItr fFileIndexItr;
00073 bool fOffLine;
00074
00075 ClassDef(DDSFileHandler,0)
00076 };
00077
00078 #endif // DDSFILEHANDLER_H
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092