From bc09cd9040dce9eabbf5fbc69db8f16282c38b9a Mon Sep 17 00:00:00 2001 From: zdenop Date: Sat, 3 May 2014 20:21:37 +0000 Subject: [PATCH] fix formating in C-API and add TessChoiceIteratorDelete git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@1092 d0cd1f9f-072b-0410-8dd7-cf729c803f20 --- api/capi.cpp | 14 ++++++++++---- api/capi.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/api/capi.cpp b/api/capi.cpp index d4fedf988a..99605d271e 100644 --- a/api/capi.cpp +++ b/api/capi.cpp @@ -724,8 +724,9 @@ TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorCons TESS_API const TessChoiceIterator* TESS_CALL TessResultIteratorGetChoiceIterator(const TessResultIterator* handle) { - return new TessChoiceIterator(*handle); + return new TessChoiceIterator(*handle); } + TESS_API BOOL TESS_CALL TessResultIteratorNext(TessResultIterator* handle, TessPageIteratorLevel level) { return handle->Next(level); @@ -788,17 +789,22 @@ TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap(const TessResultIterat return handle->SymbolIsDropcap() ? TRUE : FALSE; } +TESS_API void TESS_CALL TessChoiceIteratorDelete(TessChoiceIterator* handle) +{ + delete handle; +} + TESS_API BOOL TESS_CALL TessChoiceIteratorNext(TessChoiceIterator* handle) { - return handle->Next(); + return handle->Next(); } TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text(const TessChoiceIterator* handle) { - return handle->GetUTF8Text(); + return handle->GetUTF8Text(); } TESS_API float TESS_CALL TessChoiceIteratorConfidence(const TessChoiceIterator* handle) { - return handle->Confidence(); + return handle->Confidence(); } diff --git a/api/capi.h b/api/capi.h index d731bd6f40..1cc8b6b716 100644 --- a/api/capi.h +++ b/api/capi.h @@ -367,6 +367,7 @@ TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript(const TessResultI TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript(const TessResultIterator* handle); TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap(const TessResultIterator* handle); +TESS_API void TESS_CALL TessChoiceIteratorDelete(TessChoiceIterator* handle); TESS_API BOOL TESS_CALL TessChoiceIteratorNext(TessChoiceIterator* handle); TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text(const TessChoiceIterator* handle); TESS_API float TESS_CALL TessChoiceIteratorConfidence(const TessChoiceIterator* handle);