23#ifdef UNDREAMAI_EXPORTS
24#define UNDREAMAI_API __declspec(dllexport)
26#define UNDREAMAI_API __declspec(dllimport)
32using json = nlohmann::ordered_json;
34typedef void (*CharArrayFn)(
const char *);
42inline std::string join_paths(
const std::string &a,
const std::string &b)
53inline bool file_exists(
const std::string &path)
56 return stat(path.c_str(), &s) == 0;
59inline bool is_file(
const std::string &path)
62 return stat(path.c_str(), &s) == 0 && s.st_mode & S_IFREG;
65inline bool is_directory(
const std::string &path)
68 return stat(path.c_str(), &s) == 0 && s.st_mode & S_IFDIR;
71inline bool always_false()
76inline std::string args_to_command(
int argc,
char **argv)
78 std::string command =
"";
79 for (
int i = 1; i < argc; ++i)
88static inline const char *stringToCharArray(
const std::string &input)
90 char *content =
new char[input.length() + 1];
91 strcpy(content, input.c_str());
97 UNDREAMAI_API
void CharArray_Delete(
char *
object);
100inline void CharArray_Delete(
char *str)