Compare commits

...

1 Commits

Author SHA1 Message Date
Martchus c41d52b7c9 WIP: Add method to execute an external application 2017-02-12 00:17:33 +01:00
2 changed files with 22 additions and 0 deletions

View File

@ -76,6 +76,24 @@ void startConsole()
ios::sync_with_stdio(true);
}
#ifdef PLATFORM_UNIX
/*!
* \brief Executes the specified \a app with the specified \a args.
* \param app Specifies the null-terminated application path.
* \param args Specifies the arguments as null-terminated array of null-terminated strings.
* \param outstring Specifies a string to save the standard output.
* \param errstring Specifies a string to save the standard error.
* \param outstream Specifies a stream to forward the standard output.
* \param errstream Specifies a stream to forward the standard error.
* \return Returns the return code.
* \throws Throws a std::runtime_error in case an error occurs.
*/
int execApp(const char *app, const char *const *args, string *outstring, string *errstring, ostream *outstream, ostream *errstream)
{
}
#endif
/*!
* \brief Convert command line arguments to UTF-8.
* \remarks Only available on Windows (on other platforms we can assume passed arguments are already UTF-8 encoded).

View File

@ -38,6 +38,10 @@ std::pair<std::vector<std::unique_ptr<char[]> >, std::vector<char *> > CPP_UTILI
# define CMD_UTILS_CONVERT_ARGS_TO_UTF8
#endif
#ifdef PLATFORM_UNIX
int execApp(const char *app, const char *const *args, std::string *outstring, std::string *errstring, std::ostream *outstream, std::ostream *errstream);
#endif
/*!
* \brief The Indentation class allows printing indentation conveniently, eg. cout << Indentation(4) << ...
*/