Back to index

nordugrid-arc-nox  1.1.0~rc6
JobLogFile.h
Go to the documentation of this file.
00001 #ifndef JOBLOGFILE_H
00002 #define JOBLOGFILE_H
00003 
00004 
00005 #include <time.h>
00006 #include <stdexcept>
00007 #include <fstream>
00008 #include <string>
00009 #include <map>
00010 #include <arc/XMLNode.h>
00011 #include <arc/DateTime.h>
00012 
00013 namespace Arc
00014 {
00015   class JobLogFile: public std::map<std::string, std::string>
00020   {
00021     std::string filename;
00022     bool allow_remove;
00023     std::string getArchivingPath();
00024   public:
00026     JobLogFile(const std::string& _filename):allow_remove(true) { parse(_filename); } 
00028     int parse(const std::string& _filename);
00036     void createUsageRecord(Arc::XMLNode &usagerecord,
00037                            const char *recordid_prefix="ur-");
00039     std::string getFilename() { return filename; }
00041     void allowRemove(bool a) { allow_remove=a; }
00043     bool exists();
00045     bool olderThan(time_t age);
00047     void remove();
00048   };
00049 }
00050 
00051 #endif