2021-03-12 17:05:50 +01:00
|
|
|
#pragma once
|
2021-03-17 21:15:00 +01:00
|
|
|
#include <optional>
|
2021-03-12 17:05:50 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Soundux
|
|
|
|
{
|
|
|
|
namespace Helpers
|
|
|
|
{
|
|
|
|
#if defined(_WIN32)
|
|
|
|
std::wstring widen(const std::string &s);
|
2021-04-18 19:10:11 +02:00
|
|
|
std::string narrow(const std::wstring &s);
|
2021-03-12 17:05:50 +01:00
|
|
|
#endif
|
|
|
|
#if defined(__linux__)
|
2021-03-17 21:15:00 +01:00
|
|
|
std::optional<int> getPpid(int pid);
|
2021-03-12 17:05:50 +01:00
|
|
|
#endif
|
2021-03-18 20:46:33 +01:00
|
|
|
bool exec(const std::string &command, std::string &result);
|
2021-04-13 21:34:26 +02:00
|
|
|
bool deleteFile(const std::string &path, bool trash = true);
|
2021-03-12 17:05:50 +01:00
|
|
|
std::vector<std::string> splitByNewLine(const std::string &str);
|
|
|
|
} // namespace Helpers
|
|
|
|
} // namespace Soundux
|