| 8324 | } |
| 8325 | |
| 8326 | String GetCapturedString() { |
| 8327 | if (uncaptured_fd_ != -1) { |
| 8328 | // Restores the original stream. |
| 8329 | fflush(NULL); |
| 8330 | dup2(uncaptured_fd_, fd_); |
| 8331 | close(uncaptured_fd_); |
| 8332 | uncaptured_fd_ = -1; |
| 8333 | } |
| 8334 | |
| 8335 | FILE* const file = posix::FOpen(filename_.c_str(), "r"); |
| 8336 | const String content = ReadEntireFile(file); |
| 8337 | posix::FClose(file); |
| 8338 | return content; |
| 8339 | } |
| 8340 | |
| 8341 | private: |
| 8342 | // Reads the entire content of a file as a String. |
no test coverage detected