mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-12 23:49:06 +08:00
partly Revert "Add more initial values for class Classify from constructor to header file" to improve backwards API compatibility
This reverts commit 601ee34276
.
This commit is contained in:
parent
b36cd63922
commit
c423ad4215
@ -2,6 +2,7 @@
|
||||
* File: serialis.cpp (Formerly serialmac.h)
|
||||
* Description: Inline routines and macros for serialisation functions
|
||||
* Author: Phil Cheatle
|
||||
* Created: Tue Oct 08 08:33:12 BST 1991
|
||||
*
|
||||
* (C) Copyright 1990, Hewlett-Packard Ltd.
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -204,7 +205,7 @@ bool TFile::Open(const STRING& filename, FileReader reader) {
|
||||
if (reader == nullptr)
|
||||
return LoadDataFromFile(filename.c_str(), data_);
|
||||
else
|
||||
return (*reader)(filename.c_str(), data_);
|
||||
return (*reader)(filename, data_);
|
||||
}
|
||||
|
||||
bool TFile::Open(const char* data, int size) {
|
||||
@ -312,7 +313,7 @@ bool TFile::CloseWrite(const STRING& filename, FileWriter writer) {
|
||||
if (writer == nullptr)
|
||||
return SaveDataToFile(*data_, filename.c_str());
|
||||
else
|
||||
return (*writer)(*data_, filename.c_str());
|
||||
return (*writer)(*data_, filename);
|
||||
}
|
||||
|
||||
int TFile::FWrite(const void* buffer, size_t size, int count) {
|
||||
|
@ -46,10 +46,10 @@ constexpr size_t countof(T const (&)[N]) noexcept {
|
||||
|
||||
// Function to read a GenericVector<char> from a whole file.
|
||||
// Returns false on failure.
|
||||
using FileReader = bool (*)(const char* filename, GenericVector<char>* data);
|
||||
using FileReader = bool (*)(const STRING&, GenericVector<char>*);
|
||||
// Function to write a GenericVector<char> to a whole file.
|
||||
// Returns false on failure.
|
||||
using FileWriter = bool (*)(const GenericVector<char>& data, const char* filename);
|
||||
using FileWriter = bool (*)(const GenericVector<char>&, const STRING&);
|
||||
|
||||
// Deserialize data from file.
|
||||
bool DeSerialize(FILE* fp, char* data, size_t n = 1);
|
||||
|
Loading…
Reference in New Issue
Block a user