MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / LoadFileRaw

Function LoadFileRaw

tensorflow/lite/schema/flatbuffer_compatibility_test.cc:27–41  ·  view source on GitHub ↗

Load filename `name`

Source from the content-addressed store, hash-verified

25#endif
26/// Load filename `name`
27bool LoadFileRaw(const char *name, std::string *buf) {
28 std::ifstream fp(name, std::ios::binary);
29 if (!fp) {
30 fprintf(stderr, "Failed to read '%s'\n", name);
31 return false;
32 }
33 std::string s((std::istreambuf_iterator<char>(fp)),
34 std::istreambuf_iterator<char>());
35 if (s.empty()) {
36 fprintf(stderr, "Read '%s' resulted in empty\n", name);
37 return false;
38 }
39 *buf = s;
40 return true;
41}
42
43bool ParseFile(flatbuffers::Parser *parser, const std::string &filename,
44 const std::string &contents) {

Callers 1

TESTFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected