MCPcopy Create free account
hub / github.com/aras-p/ClangBuildAnalyzer / ReadFileToString

Function ReadFileToString

src/main.cpp:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30#include "external/cute_files.h"
31
32static void ReadFileToString(const std::string& path, std::string& str)
33{
34 str.resize(0);
35 FILE* f = fopen(path.c_str(), "rb");
36 if (!f)
37 return;
38 fseek(f, 0, SEEK_END);
39 size_t fsize = ftello64(f);
40 fseek(f, 0, SEEK_SET);
41 str.resize(fsize);
42 fread(&str[0], 1, fsize, f);
43 fclose(f);
44}
45
46static bool CompareIgnoreNewlines(const std::string& a, const std::string& b)
47{

Callers 1

RunOneTestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected