MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / wrap

Function wrap

libaegisub/lua/modules/lfs.cpp:32–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace {
31template<typename Func>
32auto wrap(char **err, Func f) -> decltype(f()) {
33 try {
34 return f();
35 }
36 catch (std::exception const& e) {
37 *err = strdup(e.what());
38 }
39 catch (agi::Exception const& e) {
40 *err = strndup(e.GetMessage());
41 }
42 catch (...) {
43 *err = strdup("Unknown error");
44 }
45 return 0;
46}
47
48template<typename Ret>
49bool setter(const char *path, char **err, Ret (*f)(agi::fs::path const&)) {

Callers 7

setterFunction · 0.70
currentdirFunction · 0.70
dir_nextFunction · 0.70
dir_newFunction · 0.70
get_modeFunction · 0.70
get_mtimeFunction · 0.70
get_sizeFunction · 0.70

Calls 1

strndupFunction · 0.85

Tested by

no test coverage detected