Warning, file /include/google/protobuf/compiler/subprocess.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef GOOGLE_PROTOBUF_COMPILER_SUBPROCESS_H__
0011 #define GOOGLE_PROTOBUF_COMPILER_SUBPROCESS_H__
0012
0013 #ifdef _WIN32
0014 #ifndef WIN32_LEAN_AND_MEAN
0015 #define WIN32_LEAN_AND_MEAN
0016 #endif
0017 #include <windows.h>
0018 #else
0019 #include <sys/types.h>
0020 #include <unistd.h>
0021 #endif
0022 #include <string>
0023
0024 #include "google/protobuf/port.h"
0025
0026
0027 #include "google/protobuf/port_def.inc"
0028
0029 namespace google {
0030 namespace protobuf {
0031
0032 class Message;
0033
0034 namespace compiler {
0035
0036
0037 class PROTOC_EXPORT Subprocess {
0038 public:
0039 Subprocess();
0040 ~Subprocess();
0041
0042 enum SearchMode {
0043 SEARCH_PATH,
0044 EXACT_NAME
0045 };
0046
0047
0048
0049 void Start(const std::string& program, SearchMode search_mode);
0050
0051
0052
0053
0054
0055
0056 bool Communicate(const Message& input, Message* output, std::string* error);
0057
0058 #ifdef _WIN32
0059
0060
0061 static std::string Win32ErrorMessage(DWORD error_code);
0062 #endif
0063
0064 private:
0065 #ifdef _WIN32
0066 DWORD process_start_error_;
0067 HANDLE child_handle_;
0068
0069
0070
0071 HANDLE child_stdin_;
0072 HANDLE child_stdout_;
0073
0074 #else
0075 pid_t child_pid_;
0076
0077
0078
0079 int child_stdin_;
0080 int child_stdout_;
0081
0082 #endif
0083 };
0084
0085 }
0086 }
0087 }
0088
0089 #include "google/protobuf/port_undef.inc"
0090
0091 #endif