MCPcopy Create free account
hub / github.com/MaskRay/ccls / writeToFile

Function writeToFile

src/utils.cc:166–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void writeToFile(const std::string &filename, const std::string &content) {
167 FILE *f = fopen(filename.c_str(), "wb");
168 if (!f || (content.size() && fwrite(content.c_str(), content.size(), 1, f) != 1)) {
169 LOG_S(ERROR) << "failed to write to " << filename << ' ' << strerror(errno);
170 return;
171 }
172 fclose(f);
173}
174
175// Find discontinous |search| in |content|.
176// Return |found| and the count of skipped chars before found.

Callers 2

indexer_ParseFunction · 0.85
updateTestExpectationFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 1

updateTestExpectationFunction · 0.68