Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:16:11

0001 #ifndef FUN4ALL_INPUTFILEHANDLER_H
0002 #define FUN4ALL_INPUTFILEHANDLER_H
0003 
0004 #include <list>
0005 #include <string>
0006 
0007 class InputFileHandler
0008 {
0009  public:
0010   InputFileHandler() = default;
0011   virtual ~InputFileHandler() = default;
0012   virtual int fileopen(const std::string & /*filename*/) { return 0; }
0013   virtual int fileclose() { return -1; }
0014   int OpenNextFile();
0015   int AddListFile(const std::string &filename);
0016   int AddFile(const std::string &filename);
0017   void AddToFileOpened(const std::string &filename) { m_FileListOpened.push_back(filename); }
0018   void Print(const std::string &what = "ALL") const;
0019   int IsOpen() const { return m_IsOpen; }
0020   void IsOpen(const int i) { m_IsOpen = i; }
0021   void SetVerbosity(const int i) { m_Verbosity = i; }
0022   int GetVerbosity() const { return m_Verbosity; }
0023   const std::list<std::string> &GetFileList() const { return m_FileList; }
0024   void UpdateFileList();
0025   void FileName(const std::string &fn) { m_FileName = fn; }
0026   const std::string &FileName() const { return m_FileName; }
0027 
0028  private:
0029   int m_IsOpen {0};
0030   int m_Repeat {0};
0031   int m_Verbosity {0};
0032   std::string m_FileName;
0033   std::list<std::string> m_FileList;
0034   std::list<std::string> m_FileListCopy;
0035   std::list<std::string> m_FileListOpened;  // all files which were opened during running
0036 };
0037 
0038 #endif