Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

IoFileListItem.h

Go to the documentation of this file.
00001 
00002 // IoFileListItem
00003 //
00004 // Package: Io (IoModules)
00005 //
00006 // Concept: Helper class to associate a file path, including wildcards,
00007 //          with an associated file list and stream list.
00008 //
00009 // schubert@hep.umn.edu
00011 #ifndef IOFILELISTITEM_H
00012 #define IOFILELISTITEM_H
00013 
00014 #include <iosfwd>
00015 #include <list>
00016 #include <map>
00017 #include <vector>
00018 
00019 class IoFileListItem;
00020 std::ostream& operator << (std::ostream& os, const IoFileListItem& ifl);
00021 
00022 class IoFileListItem {
00023 
00024 public:
00025   // Typedefs and enumerations
00026   typedef std::map< std::string, std::string > FileStreamMap;
00027   typedef FileStreamMap::iterator FileStreamMapItr;
00028   typedef FileStreamMap::const_iterator FileStreamMapConstItr;
00029 
00030   // Constructor and destructor
00031   IoFileListItem(const char* filepath,int at,const char* streamlist);
00032   virtual ~IoFileListItem();
00033 
00034   // State testing methods
00035   int GetAt() const { return fAt; }
00036   const FileStreamMap& GetFileStreamMap() const { return fFileStreamMap; }
00037   int GetNumFile() const { return fFileStreamMap.size(); }
00038   virtual std::ostream& Print(std::ostream& os) const;
00039 
00040   // Stage changing methods  
00041   void RemoveFile(const char* filename, const char* streamlist);
00042 
00043 private:
00044   std::list<std::string> BuildFileIndex(std::string filepath);
00045   void BuildDirIndex(std::string dirpath,std::string subdir,
00046                      std::vector<std::string>& subdirlist) const;
00047   std::string  BuildDefStreamList(std::string filename);
00048 
00049   std::string   fFilePath;  // file path used to construct file list
00050   int           fAt;        // index at which to add these files
00051   FileStreamMap fFileStreamMap; //file name/stream list pairs
00052  
00053 };
00054 
00055 #endif // IOFILELISTITEM_H
00056 

Generated on Mon Feb 15 11:06:48 2010 for loon by  doxygen 1.3.9.1