| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 #ifndef SRC_TOOLS_DRIVER_CONNECTION_H_ | 5 #ifndef SRC_TOOLS_DRIVER_CONNECTION_H_ |
| 6 #define SRC_TOOLS_DRIVER_CONNECTION_H_ | 6 #define SRC_TOOLS_DRIVER_CONNECTION_H_ |
| 7 | 7 |
| 8 #include "src/shared/globals.h" | 8 #include "src/shared/globals.h" |
| 9 | 9 |
| 10 #include "src/shared/connection.h" | 10 #include "src/shared/connection.h" |
| 11 | 11 |
| 12 namespace fletch { | 12 namespace dartino { |
| 13 | 13 |
| 14 class Socket; | 14 class Socket; |
| 15 | 15 |
| 16 class DriverConnection { | 16 class DriverConnection { |
| 17 public: | 17 public: |
| 18 // If you modify this enum, please update | 18 // If you modify this enum, please update |
| 19 // pkg/fletchc/lib/src/driver/driver_commands.dart as well. | 19 // pkg/dartino_compiler/lib/src/driver/driver_commands.dart as well. |
| 20 enum Command { | 20 enum Command { |
| 21 kStdin, // Data on stdin. | 21 kStdin, // Data on stdin. |
| 22 kStdout, // Data on stdout. | 22 kStdout, // Data on stdout. |
| 23 kStderr, // Data on stderr. | 23 kStderr, // Data on stderr. |
| 24 kArguments, // Command-line arguments. | 24 kArguments, // Command-line arguments. |
| 25 kSignal, // Unix process signal received. | 25 kSignal, // Unix process signal received. |
| 26 kExitCode, // Set process exit code. | 26 kExitCode, // Set process exit code. |
| 27 kEventLoopStarted, // Not used. | 27 kEventLoopStarted, // Not used. |
| 28 kClosePort, // Not used. | 28 kClosePort, // Not used. |
| 29 kSendPort, // Not used. | 29 kSendPort, // Not used. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 47 uint8* ReadBytes(int* length) { return incoming_.ReadBytes(length); } | 47 uint8* ReadBytes(int* length) { return incoming_.ReadBytes(length); } |
| 48 | 48 |
| 49 void Send(Command command, const WriteBuffer& buffer); | 49 void Send(Command command, const WriteBuffer& buffer); |
| 50 Command Receive(); | 50 Command Receive(); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 Socket* socket_; | 53 Socket* socket_; |
| 54 ReadBuffer incoming_; | 54 ReadBuffer incoming_; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace fletch | 57 } // namespace dartino |
| 58 | 58 |
| 59 #endif // SRC_TOOLS_DRIVER_CONNECTION_H_ | 59 #endif // SRC_TOOLS_DRIVER_CONNECTION_H_ |
| OLD | NEW |