/* $(prefix)/share/doc/mmex */ const wxFileName mmex::GetDocDir() { static wxFileName fname; if (!fname.IsOk()) { fname = GetSharedDir(); const wxArrayString &dirs = fname.GetDirs(); if (dirs.Last().Lower() == GetAppName()) fname.RemoveLastDir(); // mmex folder fname.AppendDir("doc"); fname.AppendDir(GetAppName()); } return fname; }
/* $(prefix)/share/mmex/res */ const wxFileName mmex::GetResourceDir() { static wxFileName fname; if (!fname.IsOk()) { fname = GetSharedDir(); fname.AppendDir("res"); } return fname; }
const wxFileName mmex::GetDocDir() { static wxFileName fname; if (!fname.IsOk()) { fname = GetSharedDir(); fname.AppendDir("doc"); } return fname; }
// static helpers static const wxFileName& GetWatchDir() { static wxFileName dir; if (dir.DirExists()) return dir; wxString tmp = wxStandardPaths::Get().GetTempDir(); dir.AssignDir(tmp); // XXX look for more unique name? there is no function to generate // unique filename, the file always get created... dir.AppendDir("fswatcher_test"); CPPUNIT_ASSERT(!dir.DirExists()); CPPUNIT_ASSERT(dir.Mkdir()); return dir; }