mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-19 23:19:07 +08:00
Misc.
This commit is contained in:
parent
c812d9d894
commit
d0a730e3d0
@ -53,13 +53,13 @@ bool SaveDataToFile(const std::vector<char>& data, const char* filename);
|
||||
// Deserialize data from file.
|
||||
template <typename T>
|
||||
bool DeSerialize(FILE *fp, T *data, size_t n = 1) {
|
||||
return fread((void *)data, sizeof(T), n, fp) == n;
|
||||
return fread(data, sizeof(T), n, fp) == n;
|
||||
}
|
||||
|
||||
// Serialize data to file.
|
||||
template <typename T>
|
||||
bool Serialize(FILE *fp, const T *data, size_t n = 1) {
|
||||
return fwrite(data, sizeof(T), n, fp) == n;
|
||||
return fwrite(data, sizeof(T), n, fp) == n;
|
||||
}
|
||||
|
||||
// Simple file class.
|
||||
|
Loading…
Reference in New Issue
Block a user