exist返回数组

This commit is contained in:
xx
2024-06-14 01:48:59 +08:00
parent d09c1c8e35
commit e5b4d0fd93
2 changed files with 9 additions and 4 deletions

View File

@@ -69,10 +69,15 @@ sol::table module::process::list(sol::this_state s)
return result_table;
}
size_t module::process::exist(const std::string& filepath)
sol::table module::process::exist(const std::string& filepath, sol::this_state s)
{
//if(ylib::process::exist(filepath).)
return 0;
auto list = ylib::process::exist(filepath);
sol::state_view lua(s);
sol::table result_table = lua.create_table();
for (size_t i = 0; i < list.size(); i++)
result_table[i + 1] = list[i];
return result_table;
}
bool module::process::exist_pid(size_t pid)

View File

@@ -35,7 +35,7 @@ namespace module
/// </summary>
/// <param name="filepath"></param>
/// <returns></returns>
static size_t exist(const std::string& filepath);
static sol::table exist(const std::string& filepath, sol::this_state s);
static bool exist_pid(size_t pid);
/// <summary>
/// 取PID路径