Add utilities to a util:: namespace for clarity.

Originally committed to SVN as r5148.
This commit is contained in:
Amar Takhar 2011-01-08 19:16:11 +00:00
parent 68aa077add
commit 8f401a838a
4 changed files with 13 additions and 2 deletions

View file

@ -32,7 +32,7 @@
Aegisub::Aegisub() { Aegisub::Aegisub() {
std::string default_config("{}"); std::string default_config("{}");
opt = new agi::Options(config_path() + "config.json", default_config, agi::Options::FLUSH_SKIP); opt = new agi::Options(util::config_path() + "config.json", default_config, agi::Options::FLUSH_SKIP);
} }

View file

@ -41,7 +41,7 @@
/// @brief Init the reporter. /// @brief Init the reporter.
bool Reporter::OnInit() { bool Reporter::OnInit() {
const std::string path_log(config_path() + "log/"); const std::string path_log(util::config_path() + "log/");
wxFileName::Mkdir(path_log, 0777, wxPATH_MKDIR_FULL); wxFileName::Mkdir(path_log, 0777, wxPATH_MKDIR_FULL);
agi::log::log = new agi::log::LogSink(path_log); agi::log::log = new agi::log::LogSink(path_log);
// if ( !wxApp::OnInit() ) // if ( !wxApp::OnInit() )

View file

@ -28,6 +28,8 @@
#include "../acconf.h" #include "../acconf.h"
namespace util {
std::string config_path() { std::string config_path() {
wxStandardPathsBase &paths = wxStandardPaths::Get(); wxStandardPathsBase &paths = wxStandardPaths::Get();
@ -39,3 +41,6 @@ std::string config_path() {
return std::string(wxString::Format("%s/Aegisub/", paths.GetUserConfigDir())); return std::string(wxString::Format("%s/Aegisub/", paths.GetUserConfigDir()));
#endif #endif
} }
} // namespace util

View file

@ -19,6 +19,12 @@
/// @ingroup base /// @ingroup base
/// Utilities.
namespace util {
/// Return config path. /// Return config path.
/// @return Config path. /// @return Config path.
std::string config_path(); std::string config_path();
} // namespace util