4 # define WIN32_LEAN_AND_MEAN
15 if(value.empty() || tail.empty() || value.size() < tail.size())
20 return value.compare(value.length() - tail.size(), tail.size(), tail) == 0;
28 for(
int i = 0; i < argc; ++i)
33 const size_t pos = arg.find(
'\"');
34 if(pos != TTKString::npos)
36 arg.insert(arg.begin() + pos,
'\\');
50 const size_t pos = filePath.find_last_of(
'\\');
51 if(pos != TTKString::npos)
56 ShellExecuteA(
nullptr,
"open", (filePath + suffix).c_str(), args.c_str(),
nullptr, SW_HIDE);
58 TTKString filePath = get_current_dir_name();
59 if(readlink(
"/proc/self/exe", path,
sizeof(path) - 1) != 0)
62 const size_t pos = filePath.find_last_of(
'/');
63 if(pos != TTKString::npos)
69 system((filePath + suffix +
TTK_SPACE + args).c_str());
void run(int argc, char **argv) const
TTK_MODULE_EXPORT QString suffix(const QString &name)
The namespace of the process utils.
#define TTK_APP_FILE_NAME
#define TTK_SERVICE_RUN_NAME
#define TTK_STR_QUOTES(s)
static bool endWith(const TTKString &value, const TTKString &tail)