mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 01:42:41 +00:00
Small cleanup for code sharing. Note, `*ReadFile` will trigger a CHECK-failure on error; the relevant implementations would previously have failed silently (empty string). --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
21 lines
554 B
C++
21 lines
554 B
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#ifndef CARBON_TESTING_BASE_FILE_HELPERS_H_
|
|
#define CARBON_TESTING_BASE_FILE_HELPERS_H_
|
|
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
#include "common/error.h"
|
|
|
|
namespace Carbon::Testing {
|
|
|
|
// Reads a file to string.
|
|
auto ReadFile(std::filesystem::path path) -> ErrorOr<std::string>;
|
|
|
|
} // namespace Carbon::Testing
|
|
|
|
#endif // CARBON_TESTING_BASE_FILE_HELPERS_H_
|