MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ exec_command()

std::string MayaFlux::Platform::SystemConfig::exec_command ( const char *  cmd)
staticprivate

Definition at line 158 of file HostEnvironment.cpp.

159{
160 std::array<char, 128> buffer {};
161 std::string result;
162
163 using PipeCloser = int (*)(FILE*);
164#ifdef MAYAFLUX_PLATFORM_WINDOWS
165 std::unique_ptr<FILE, PipeCloser> pipe(_popen(cmd, "r"), _pclose);
166#else
167 std::unique_ptr<FILE, PipeCloser> pipe(popen(cmd, "r"), pclose);
168#endif
169
170 if (!pipe)
171 return "";
172
173 while (fgets(buffer.data(), static_cast<int>(buffer.size()), pipe.get())) {
174 result += buffer.data();
175 }
176 return result;
177}

Referenced by get_clang_includes(), and get_clang_resource_dir().

+ Here is the caller graph for this function: