forked from google-coral/edgetpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
28 lines (20 loc) · 868 Bytes
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef EDGETPU_CPP_UTILS_H_
#define EDGETPU_CPP_UTILS_H_
#include <string>
#include "src/cpp/error_reporter.h"
namespace coral {
// Reads contents of file.
EdgeTpuApiStatus ReadFile(const std::string& file_path,
std::string* file_content,
EdgeTpuErrorReporter* reporter);
// Writes contents of file.
EdgeTpuApiStatus WriteFile(const std::string& file_content,
const std::string& file_path,
EdgeTpuErrorReporter* reporter);
// Reads contents of file or crashes if error.
void ReadFileOrDie(const std::string& file_path, std::string* file_content);
// Writes contents of file or crashes if error.
void WriteFileOrDie(const std::string& file_content,
const std::string& file_path);
} // namespace coral
#endif // EDGETPU_CPP_UTILS_H_