string ofxTweakbarSimpleStorage::getPath() { // When using the testApp::testApp() constructor the current working // directory is different than when in the testApp::setup(). Kind of wierd, // but this function takes this into account. // TODO: test/update when 007 stable is released string filepath; Poco::Path p; string curr_path = p.current(); Poco::Path p_data(curr_path + "data/"); Poco::File file(p_data); if(file.exists()) { filepath = curr_path +"data/" +getBar()->getFileName(); } else { if(POCO_OS_MAC_OS_X) { filepath = "../../../data/" +getBar()->getFileName(); } else { filepath = "data/" +getBar()->getFileName(); } } ofLog(OF_LOG_VERBOSE, filepath); return filepath; }
string getCurrentWorkingDirectory() { Poco::Path p; return p.current(); }