MCPcopy Create free account
hub / github.com/carbonengine/trinity / RunProcess

Function RunProcess

shadercompiler/EffectCompilerMetal.cpp:4198–4223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4196
4197
4198std::pair<int, std::string> RunProcess( const char* commandLine )
4199{
4200 s_fileMutex.lock();
4201#ifdef _WIN32
4202 FILE* process = _popen( commandLine, "r" );
4203#else
4204 FILE* process = popen( commandLine, "r" );
4205#endif
4206 s_fileMutex.unlock();
4207
4208 if( !process )
4209 {
4210 return std::make_pair( -1, "" );
4211 }
4212 std::string output;
4213 char readBuffer[128];
4214 while( fgets( readBuffer, sizeof( readBuffer ), process ) )
4215 {
4216 output += readBuffer;
4217 }
4218#ifdef _WIN32
4219 return std::make_pair( _pclose( process ), output );
4220#else
4221 return std::make_pair( pclose( process ), output );
4222#endif
4223}
4224
4225template <typename T>
4226void SplitString( const std::string& string, char delim, T callback )

Callers 3

DetectUnusedArgumentsFunction · 0.85
CompileCodeFunction · 0.85
CreateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected