@@ -50,6 +50,10 @@ struct COMPAT {
50
50
static string get_sync_dir () {
51
51
return string (rime_get_api ()->get_sync_dir ());
52
52
}
53
+
54
+ static string to_path (const std::string &file) {
55
+ return file;
56
+ }
53
57
};
54
58
55
59
template <typename T>
@@ -73,6 +77,10 @@ struct COMPAT<T, void_t<decltype(std::declval<T>().user_data_dir.string())>> {
73
77
T &deployer = Service::instance ().deployer ();
74
78
return deployer.sync_dir .string ();
75
79
}
80
+
81
+ static path to_path (const std::string &file) {
82
+ return path (file);
83
+ }
76
84
};
77
85
78
86
// --- wrappers for Segment
@@ -1217,7 +1225,7 @@ namespace ConfigReg {
1217
1225
int raw_make (lua_State *L) {
1218
1226
an<T> config = New<T>();
1219
1227
if (auto cstr = lua_tostring (L, 1 )) {
1220
- config->LoadFromFile (path (cstr));
1228
+ config->LoadFromFile (COMPAT::to_path (cstr));
1221
1229
}
1222
1230
LuaType<an<T>>::pushdata (L, config);
1223
1231
return 1 ;
@@ -1282,10 +1290,10 @@ namespace ConfigReg {
1282
1290
}
1283
1291
1284
1292
bool load_from_file (T &t, const string &f) {
1285
- return t.LoadFromFile (path (f));
1293
+ return t.LoadFromFile (COMPAT::to_path (f));
1286
1294
}
1287
1295
bool save_to_file (T &t, const string &f) {
1288
- return t.SaveToFile (path (f));
1296
+ return t.SaveToFile (COMPAT::to_path (f));
1289
1297
}
1290
1298
1291
1299
static const luaL_Reg funcs[] = {
0 commit comments