Lines Matching defs:file

105   std::ifstream file(filename.c_str());
107 file >> dummy;
110 file >> output;
984 const char kUnknownFile[] = "unknown file";
986 // Formats a source file path and a line number as they would appear
988 GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
989 const std::string file_name(file == nullptr ? kUnknownFile : file);
1001 // Formats a file location for compiler-independent XML output.
1005 // to the file location it produces, unlike FormatFileLocation().
1006 GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
1008 const std::string file_name(file == nullptr ? kUnknownFile : file);
1016 GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
1023 << marker << " " << FormatFileLocation(file, line).c_str()
1055 // The ctor redirects the stream to a temporary file.
1063 0, // Generate unique file name.
1066 << "Unable to create a temporary file in " << temp_dir_path;
1069 << "Unable to open temporary file " << temp_file_path;
1073 // directory, so we create the temporary file in a temporary directory.
1130 << "Failed to create tmp file " << name_template
1151 FILE* const file = posix::FOpen(filename_.c_str(), "r");
1152 if (file == nullptr) {
1153 GTEST_LOG_(FATAL) << "Failed to open tmp file " << filename_
1156 const std::string content = ReadEntireFile(file);
1157 posix::FClose(file);
1164 // Name of the temporary file holding the stderr output.
1227 size_t GetFileSize(FILE* file) {
1228 fseek(file, 0, SEEK_END);
1229 return static_cast<size_t>(ftell(file));
1232 std::string ReadEntireFile(FILE* file) {
1233 const size_t file_size = GetFileSize(file);
1239 fseek(file, 0, SEEK_SET);
1241 // Keeps reading the file until we cannot read further or the
1242 // pre-determined file size is reached.
1245 fread(buffer + bytes_read, 1, file_size - bytes_read, file);