OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart 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 file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef BIN_FILE_H_ | 5 #ifndef BIN_FILE_H_ |
6 #define BIN_FILE_H_ | 6 #define BIN_FILE_H_ |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 static CObject* WriteFromRequest(const CObjectArray& request); | 180 static CObject* WriteFromRequest(const CObjectArray& request); |
181 static CObject* CreateLinkRequest(const CObjectArray& request); | 181 static CObject* CreateLinkRequest(const CObjectArray& request); |
182 static CObject* DeleteLinkRequest(const CObjectArray& request); | 182 static CObject* DeleteLinkRequest(const CObjectArray& request); |
183 static CObject* RenameLinkRequest(const CObjectArray& request); | 183 static CObject* RenameLinkRequest(const CObjectArray& request); |
184 static CObject* LinkTargetRequest(const CObjectArray& request); | 184 static CObject* LinkTargetRequest(const CObjectArray& request); |
185 static CObject* TypeRequest(const CObjectArray& request); | 185 static CObject* TypeRequest(const CObjectArray& request); |
186 static CObject* IdenticalRequest(const CObjectArray& request); | 186 static CObject* IdenticalRequest(const CObjectArray& request); |
187 static CObject* StatRequest(const CObjectArray& request); | 187 static CObject* StatRequest(const CObjectArray& request); |
188 static CObject* LockRequest(const CObjectArray& request); | 188 static CObject* LockRequest(const CObjectArray& request); |
189 | 189 |
| 190 static void set_capture_stdout(bool value) { |
| 191 capture_stdout_ = value; |
| 192 capture_any_ = (capture_stdout_ || capture_stderr_); |
| 193 } |
| 194 static bool capture_stdout() { return capture_stdout_; } |
| 195 |
| 196 static void set_capture_stderr(bool value) { |
| 197 capture_stderr_ = value; |
| 198 capture_any_ = (capture_stdout_ || capture_stderr_); |
| 199 } |
| 200 static bool capture_stderr() { return capture_stderr_; } |
| 201 |
190 private: | 202 private: |
191 explicit File(FileHandle* handle) : handle_(handle) { } | 203 explicit File(FileHandle* handle) : handle_(handle) { } |
192 void Close(); | 204 void Close(); |
193 | 205 |
194 static const int kClosedFd = -1; | 206 static const int kClosedFd = -1; |
195 | 207 |
196 // FileHandle is an OS specific class which stores data about the file. | 208 // FileHandle is an OS specific class which stores data about the file. |
197 FileHandle* handle_; // OS specific handle for the file. | 209 FileHandle* handle_; // OS specific handle for the file. |
198 | 210 |
| 211 static bool capture_stdout_; |
| 212 static bool capture_stderr_; |
| 213 static bool capture_any_; |
| 214 |
199 DISALLOW_COPY_AND_ASSIGN(File); | 215 DISALLOW_COPY_AND_ASSIGN(File); |
200 }; | 216 }; |
201 | 217 |
202 } // namespace bin | 218 } // namespace bin |
203 } // namespace dart | 219 } // namespace dart |
204 | 220 |
205 #endif // BIN_FILE_H_ | 221 #endif // BIN_FILE_H_ |
OLD | NEW |