34 struct dirent *dirp = NULL;
35 if((dp = opendir(path.c_str())) == NULL) {
36 LOG(
"System",
pERROR) <<
"Can not open directory: " << path;
39 while ((dirp = readdir(dp)) != NULL) {
40 string filename = path +
"/" + string(dirp->d_name);
42 if(extension.size()==0) match=
true;
46 if(filenamev.size()==0)
break;
47 string file_extension = filenamev[filenamev.size()-1];
48 match = (file_extension.find(extension) != string::npos);
51 files.push_back(filename);
109 time_t now = time(0);
110 tm* local_time = localtime(&now);
112 int yr = local_time->tm_year + 1900;
113 int mon = local_time->tm_mon + 1;
114 int day = local_time->tm_mday;
115 int hr = local_time->tm_hour + 1;
116 int min = local_time->tm_min;
117 int sec = local_time->tm_sec;
120 if(local_time->tm_isdst > 0)
133 if(mon == 1 || mon == 3 || mon == 5 ||
134 mon == 7 || mon == 8 || mon == 10 || mon == 12)
151 string local_time_as_string =
152 Form(format.c_str(),yr,mon,day,hr,min,sec);
154 return local_time_as_string;
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...