CARMA C++
CarmaFileHandler.h
Go to the documentation of this file.
1 // $Id: CarmaFileHandler.h,v 1.2 2010/12/13 20:52:26 eml Exp $
2 
3 #ifndef SZA_ANTENNA_CORBA_CARMAFILEHANDLER_H
4 #define SZA_ANTENNA_CORBA_CARMAFILEHANDLER_H
5 
15 #include "carma/szautil/DirList.h"
16 #include "carma/szautil/String.h"
17 
18 #include <string>
19 #include <vector>
20 
21 namespace sza {
22  namespace antenna {
23  namespace corba {
24 
25  class CarmaFileHandler {
26  public:
27 
31  CarmaFileHandler(std::string dir);
32 
36  virtual ~CarmaFileHandler();
37 
38  // Return true if we are at the end of the file list
39 
40  bool atEnd();
41 
42  std::string getNextFile();
43  void markCurrentFileAsComplete();
44 
45  void getFileList(std::string dir);
46  void generateFileList();
47 
48  // Load the list of completed files from disk
49 
50  void loadCompletedFiles();
51 
52  // Write the list of completed files back to disk
53 
54  void writeCompletedFiles();
55 
56  // Purge files in the "completed" list that are older than the
57  // first file in our list
58 
59  void mergeFileLists();
60 
61  void setCompletedFileList(std::string fileList);
62 
63  virtual bool isFileType(sza::util::String& fileName);
64 
65  friend std::ostream& operator<<(std::ostream& os, CarmaFileHandler& handler);
66 
67  protected:
68 
69  std::string dir_;
70  unsigned nFile_;
71  int iFile_;
72 
73  std::vector<std::string> fileNames_;
74 
75  // A list of completed files
76 
77  std::vector<std::string> completedFiles_;
78  std::vector<std::string> lastCompletedFiles_;
79 
80  // The name of a file containing the list of completed files
81 
82  std::string completedFileList_;
83 
84  }; // End class CarmaFileHandler
85 
86  std::ostream& operator<<(std::ostream& os, CarmaFileHandler& handler);
87 
88  } // End namespace corba
89  } // End namespace antenna
90 } // End namespace sza
91 
92 
93 
94 #endif // End #ifndef SZA_ANTENNA_CORBA_CARMAFILEHANDLER_H
Tagged: Thu Feb 7 01:42:41 NZDT 2008.
Tagged: Wed May 12 09:30:13 PDT 2004.