00001 #ifndef EPT_POPCON_SOURCEDIR_H 00002 #define EPT_POPCON_SOURCEDIR_H 00003 00009 /* 00010 * Copyright (C) 2003,2004,2005,2006,2007 Enrico Zini <enrico@debian.org> 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU General Public License as published by 00014 * the Free Software Foundation; either version 2 of the License, or 00015 * (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 */ 00026 00027 #include <ept/popcon/popcon.h> 00028 #include <wibble/sys/fs.h> 00029 #include <string> 00030 #include <map> 00031 00032 namespace ept { 00033 namespace popcon { 00034 00038 class SourceDir : public wibble::sys::fs::Directory 00039 { 00040 protected: 00041 enum FileType { SKIP, RAW, RAWGZ }; 00042 00043 // Check if a file name is a tag file, a vocabulary file or a file to skip. 00044 // Please notice that it works on file names, not paths. 00045 FileType fileType(const std::string& name); 00046 00047 public: 00048 SourceDir(const std::string& path) : Directory(path) {} 00049 00051 time_t timestamp(); 00052 00056 bool readScores(std::map<std::string, Score>& out, size_t& submissions); 00057 }; 00058 00059 } 00060 } 00061 00062 // vim:set ts=4 sw=4: 00063 #endif