fix "cannot pass non-trivial object of type 'std::string'"

This commit is contained in:
zdenop 2023-01-06 18:34:16 +01:00
parent 8a26329623
commit 005bfe4950

View File

@ -66,18 +66,18 @@ static int Main(int argc, char **argv) {
// Load input files
for (int arg = 1; arg < argc; ++arg) {
std::filesystem::path filePath = argv[arg];
std::string file_data = tesseract::ReadFile(filePath.u8string());
std::string file_data = tesseract::ReadFile(argv[arg]);
if (file_data.empty()) {
continue;
}
std::vector<std::string> texts;
if (filePath.extension() == ".box") {
tprintf("Extracting unicharset from box file %s\n", filePath.u8string());
tprintf("Extracting unicharset from box file %s\n", argv[arg]);
bool res = ReadMemBoxes(-1, /*skip_blanks*/ true, &file_data[0],
/*continue_on_failure*/ false, /*boxes*/ nullptr, &texts,
/*box_texts*/ nullptr, /*pages*/ nullptr);
if (!res) {
tprintf("Can not read box data from '%s'\n", filePath.u8string());
tprintf("Can not read box data from '%s'\n", argv[arg]);
return EXIT_FAILURE;
}
} else {