| 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 | |
| 202 private: | 190 private: |
| 203 explicit File(FileHandle* handle) : handle_(handle) { } | 191 explicit File(FileHandle* handle) : handle_(handle) { } |
| 204 void Close(); | 192 void Close(); |
| 205 | 193 |
| 206 static const int kClosedFd = -1; | 194 static const int kClosedFd = -1; |
| 207 | 195 |
| 208 // FileHandle is an OS specific class which stores data about the file. | 196 // FileHandle is an OS specific class which stores data about the file. |
| 209 FileHandle* handle_; // OS specific handle for the file. | 197 FileHandle* handle_; // OS specific handle for the file. |
| 210 | 198 |
| 211 static bool capture_stdout_; | |
| 212 static bool capture_stderr_; | |
| 213 static bool capture_any_; | |
| 214 | |
| 215 DISALLOW_COPY_AND_ASSIGN(File); | 199 DISALLOW_COPY_AND_ASSIGN(File); |
| 216 }; | 200 }; |
| 217 | 201 |
| 218 } // namespace bin | 202 } // namespace bin |
| 219 } // namespace dart | 203 } // namespace dart |
| 220 | 204 |
| 221 #endif // BIN_FILE_H_ | 205 #endif // BIN_FILE_H_ |
| OLD | NEW |