mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-05 02:47:00 +08:00
UNICHARSET: Use new serialization API
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
eb90068b5f
commit
66bc012d27
@ -354,15 +354,13 @@ class UNICHARSET {
|
||||
// Returns true if the operation is successful.
|
||||
bool save_to_file(FILE *file) const {
|
||||
STRING str;
|
||||
if (!save_to_string(&str)) return false;
|
||||
if (fwrite(&str[0], str.length(), 1, file) != 1) return false;
|
||||
return true;
|
||||
return save_to_string(&str) &&
|
||||
tesseract::Serialize(file, &str[0], str.length());
|
||||
}
|
||||
|
||||
bool save_to_file(tesseract::TFile *file) const {
|
||||
STRING str;
|
||||
if (!save_to_string(&str)) return false;
|
||||
if (file->FWrite(&str[0], str.length(), 1) != 1) return false;
|
||||
return true;
|
||||
return save_to_string(&str) && file->Serialize(&str[0], str.length());
|
||||
}
|
||||
|
||||
// Saves the content of the UNICHARSET to the given STRING.
|
||||
|
Loading…
Reference in New Issue
Block a user