#include <shlobj.h>
+#include <msp/core/application.h>
#include "dir.h"
using namespace std;
return ".";
}
-Path get_user_data_dir(const string &appname)
+Path get_user_data_dir()
{
+ const string &appname = Application::get_name();
if(appname.empty())
- throw invalid_argument("get_user_data_dir");
+ throw logic_error("no application name");
+
char datadir[MAX_PATH];
if(SHGetFolderPath(0, CSIDL_LOCAL_APPDATA, 0, 0, datadir)==S_OK)
return Path(datadir)/appname;