https://github.com/shader-slang/slang
Raw File
Tip revision: f51f69d045d9e0b83d9ab1f4623d4319ce1867be authored by Yong He on 30 November 2022, 22:53:53 UTC
Fix missing semantic highlighting in attributes and ExtractExitentialValueExpr. (#2541)
Tip revision: f51f69d
slang-process-util.h
// slang-process-util.h
#ifndef SLANG_PROCESS_UTIL_H
#define SLANG_PROCESS_UTIL_H

#include "slang-process.h"

namespace Slang {

struct ExecuteResult
{
    typedef int ResultCode;

    void init()
    {
        resultCode = 0;
        standardOutput = String();
        standardError = String();
    }

    ResultCode resultCode;
    String standardOutput;
    String standardError;
};

struct ProcessUtil
{
        /// Execute the command line 
    static SlangResult execute(const CommandLine& commandLine, ExecuteResult& outExecuteResult);

        /// Read from read from streams until process terminates.
        /// Passing nullptr for a stream, will just discard what's in the stream
    static SlangResult readUntilTermination(Process* process, List<Byte>* outStdOut, List<Byte>* stdError);

        /// Read streams from process. 
    static SlangResult readUntilTermination(Process* process, ExecuteResult& outExecuteResult);
};

}

#endif // SLANG_PROCESS_UTIL_H
back to top