Go to the documentation of this file.00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef EPT_TEXTSEARCH_PATH_H
00025 #define EPT_TEXTSEARCH_PATH_H
00026
00027 #include <string>
00028
00029 struct stat;
00030
00031 namespace ept {
00032 namespace textsearch {
00033
00037 class Path
00038 {
00039 public:
00040 static std::string indexDir();
00041 static std::string index();
00042
00043
00044 static void setIndexDir( const std::string &s );
00045
00046 static int access( const std::string &, int );
00047 static time_t indexTimestamp();
00048 static void setTimestamp(time_t ts);
00049
00050
00051 class OverrideIndexDir
00052 {
00053 std::string old;
00054 public:
00055 OverrideIndexDir(const std::string& path) : old(Path::indexDir())
00056 {
00057 Path::setIndexDir(path);
00058 }
00059 ~OverrideIndexDir() { Path::setIndexDir(old); }
00060 };
00061
00062 protected:
00063 static Path *s_instance;
00064 static Path &instance();
00065
00066
00067 std::string m_indexDir;
00068 };
00069
00070 }
00071 }
00072
00073
00074 #endif