Update RecognizeTable.
This commit is contained in:
170
ocr/CMakeLists.txt
Normal file
170
ocr/CMakeLists.txt
Normal file
@@ -0,0 +1,170 @@
|
||||
#
|
||||
# Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
||||
set(ocr_public_header
|
||||
include/alibabacloud/ocr/OcrClient.h
|
||||
include/alibabacloud/ocr/OcrExport.h )
|
||||
|
||||
set(ocr_public_header_model
|
||||
include/alibabacloud/ocr/model/GetAsyncJobResultRequest.h
|
||||
include/alibabacloud/ocr/model/GetAsyncJobResultResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeAccountPageRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeAccountPageResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeBankCardRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeBankCardResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeBusinessCardRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeBusinessCardResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeCharacterRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeCharacterResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeChinapassportRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeChinapassportResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeDriverLicenseResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeIdentityCardRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h
|
||||
include/alibabacloud/ocr/model/RecognizePassportMRZRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizePassportMRZResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeQrCodeResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeStampRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeStampResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTableRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeTableResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTakeoutOrderRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeVINCodeResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeVerificationcodeRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeVerificationcodeResult.h
|
||||
include/alibabacloud/ocr/model/TrimDocumentRequest.h
|
||||
include/alibabacloud/ocr/model/TrimDocumentResult.h )
|
||||
|
||||
set(ocr_src
|
||||
src/OcrClient.cc
|
||||
src/model/GetAsyncJobResultRequest.cc
|
||||
src/model/GetAsyncJobResultResult.cc
|
||||
src/model/RecognizeAccountPageRequest.cc
|
||||
src/model/RecognizeAccountPageResult.cc
|
||||
src/model/RecognizeBankCardRequest.cc
|
||||
src/model/RecognizeBankCardResult.cc
|
||||
src/model/RecognizeBusinessCardRequest.cc
|
||||
src/model/RecognizeBusinessCardResult.cc
|
||||
src/model/RecognizeBusinessLicenseRequest.cc
|
||||
src/model/RecognizeBusinessLicenseResult.cc
|
||||
src/model/RecognizeCharacterRequest.cc
|
||||
src/model/RecognizeCharacterResult.cc
|
||||
src/model/RecognizeChinapassportRequest.cc
|
||||
src/model/RecognizeChinapassportResult.cc
|
||||
src/model/RecognizeDriverLicenseRequest.cc
|
||||
src/model/RecognizeDriverLicenseResult.cc
|
||||
src/model/RecognizeDrivingLicenseRequest.cc
|
||||
src/model/RecognizeDrivingLicenseResult.cc
|
||||
src/model/RecognizeIdentityCardRequest.cc
|
||||
src/model/RecognizeIdentityCardResult.cc
|
||||
src/model/RecognizeLicensePlateRequest.cc
|
||||
src/model/RecognizeLicensePlateResult.cc
|
||||
src/model/RecognizePassportMRZRequest.cc
|
||||
src/model/RecognizePassportMRZResult.cc
|
||||
src/model/RecognizeQrCodeRequest.cc
|
||||
src/model/RecognizeQrCodeResult.cc
|
||||
src/model/RecognizeStampRequest.cc
|
||||
src/model/RecognizeStampResult.cc
|
||||
src/model/RecognizeTableRequest.cc
|
||||
src/model/RecognizeTableResult.cc
|
||||
src/model/RecognizeTakeoutOrderRequest.cc
|
||||
src/model/RecognizeTakeoutOrderResult.cc
|
||||
src/model/RecognizeTaxiInvoiceRequest.cc
|
||||
src/model/RecognizeTaxiInvoiceResult.cc
|
||||
src/model/RecognizeTrainTicketRequest.cc
|
||||
src/model/RecognizeTrainTicketResult.cc
|
||||
src/model/RecognizeVATInvoiceRequest.cc
|
||||
src/model/RecognizeVATInvoiceResult.cc
|
||||
src/model/RecognizeVINCodeRequest.cc
|
||||
src/model/RecognizeVINCodeResult.cc
|
||||
src/model/RecognizeVerificationcodeRequest.cc
|
||||
src/model/RecognizeVerificationcodeResult.cc
|
||||
src/model/TrimDocumentRequest.cc
|
||||
src/model/TrimDocumentResult.cc )
|
||||
|
||||
add_library(ocr ${LIB_TYPE}
|
||||
${ocr_public_header}
|
||||
${ocr_public_header_model}
|
||||
${ocr_src})
|
||||
|
||||
set_target_properties(ocr
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}ocr
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(ocr
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_OCR_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(ocr
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(ocr
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(ocr
|
||||
jsoncpp)
|
||||
target_include_directories(ocr
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(ocr
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(ocr
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(ocr
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(ocr
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${ocr_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr)
|
||||
install(FILES ${ocr_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ocr/model)
|
||||
install(TARGETS ocr
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
222
ocr/include/alibabacloud/ocr/OcrClient.h
Normal file
222
ocr/include/alibabacloud/ocr/OcrClient.h
Normal file
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_OCRCLIENT_H_
|
||||
#define ALIBABACLOUD_OCR_OCRCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "OcrExport.h"
|
||||
#include "model/GetAsyncJobResultRequest.h"
|
||||
#include "model/GetAsyncJobResultResult.h"
|
||||
#include "model/RecognizeAccountPageRequest.h"
|
||||
#include "model/RecognizeAccountPageResult.h"
|
||||
#include "model/RecognizeBankCardRequest.h"
|
||||
#include "model/RecognizeBankCardResult.h"
|
||||
#include "model/RecognizeBusinessCardRequest.h"
|
||||
#include "model/RecognizeBusinessCardResult.h"
|
||||
#include "model/RecognizeBusinessLicenseRequest.h"
|
||||
#include "model/RecognizeBusinessLicenseResult.h"
|
||||
#include "model/RecognizeCharacterRequest.h"
|
||||
#include "model/RecognizeCharacterResult.h"
|
||||
#include "model/RecognizeChinapassportRequest.h"
|
||||
#include "model/RecognizeChinapassportResult.h"
|
||||
#include "model/RecognizeDriverLicenseRequest.h"
|
||||
#include "model/RecognizeDriverLicenseResult.h"
|
||||
#include "model/RecognizeDrivingLicenseRequest.h"
|
||||
#include "model/RecognizeDrivingLicenseResult.h"
|
||||
#include "model/RecognizeIdentityCardRequest.h"
|
||||
#include "model/RecognizeIdentityCardResult.h"
|
||||
#include "model/RecognizeLicensePlateRequest.h"
|
||||
#include "model/RecognizeLicensePlateResult.h"
|
||||
#include "model/RecognizePassportMRZRequest.h"
|
||||
#include "model/RecognizePassportMRZResult.h"
|
||||
#include "model/RecognizeQrCodeRequest.h"
|
||||
#include "model/RecognizeQrCodeResult.h"
|
||||
#include "model/RecognizeStampRequest.h"
|
||||
#include "model/RecognizeStampResult.h"
|
||||
#include "model/RecognizeTableRequest.h"
|
||||
#include "model/RecognizeTableResult.h"
|
||||
#include "model/RecognizeTakeoutOrderRequest.h"
|
||||
#include "model/RecognizeTakeoutOrderResult.h"
|
||||
#include "model/RecognizeTaxiInvoiceRequest.h"
|
||||
#include "model/RecognizeTaxiInvoiceResult.h"
|
||||
#include "model/RecognizeTrainTicketRequest.h"
|
||||
#include "model/RecognizeTrainTicketResult.h"
|
||||
#include "model/RecognizeVATInvoiceRequest.h"
|
||||
#include "model/RecognizeVATInvoiceResult.h"
|
||||
#include "model/RecognizeVINCodeRequest.h"
|
||||
#include "model/RecognizeVINCodeResult.h"
|
||||
#include "model/RecognizeVerificationcodeRequest.h"
|
||||
#include "model/RecognizeVerificationcodeResult.h"
|
||||
#include "model/TrimDocumentRequest.h"
|
||||
#include "model/TrimDocumentResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT OcrClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::GetAsyncJobResultResult> GetAsyncJobResultOutcome;
|
||||
typedef std::future<GetAsyncJobResultOutcome> GetAsyncJobResultOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::GetAsyncJobResultRequest&, const GetAsyncJobResultOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetAsyncJobResultAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeAccountPageResult> RecognizeAccountPageOutcome;
|
||||
typedef std::future<RecognizeAccountPageOutcome> RecognizeAccountPageOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeAccountPageRequest&, const RecognizeAccountPageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeAccountPageAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeBankCardResult> RecognizeBankCardOutcome;
|
||||
typedef std::future<RecognizeBankCardOutcome> RecognizeBankCardOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeBankCardRequest&, const RecognizeBankCardOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeBankCardAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeBusinessCardResult> RecognizeBusinessCardOutcome;
|
||||
typedef std::future<RecognizeBusinessCardOutcome> RecognizeBusinessCardOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeBusinessCardRequest&, const RecognizeBusinessCardOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeBusinessCardAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeBusinessLicenseResult> RecognizeBusinessLicenseOutcome;
|
||||
typedef std::future<RecognizeBusinessLicenseOutcome> RecognizeBusinessLicenseOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeBusinessLicenseRequest&, const RecognizeBusinessLicenseOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeBusinessLicenseAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeCharacterResult> RecognizeCharacterOutcome;
|
||||
typedef std::future<RecognizeCharacterOutcome> RecognizeCharacterOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeCharacterRequest&, const RecognizeCharacterOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeCharacterAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeChinapassportResult> RecognizeChinapassportOutcome;
|
||||
typedef std::future<RecognizeChinapassportOutcome> RecognizeChinapassportOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeChinapassportRequest&, const RecognizeChinapassportOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeChinapassportAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeDriverLicenseResult> RecognizeDriverLicenseOutcome;
|
||||
typedef std::future<RecognizeDriverLicenseOutcome> RecognizeDriverLicenseOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeDriverLicenseRequest&, const RecognizeDriverLicenseOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeDriverLicenseAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeDrivingLicenseResult> RecognizeDrivingLicenseOutcome;
|
||||
typedef std::future<RecognizeDrivingLicenseOutcome> RecognizeDrivingLicenseOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeDrivingLicenseRequest&, const RecognizeDrivingLicenseOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeDrivingLicenseAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeIdentityCardResult> RecognizeIdentityCardOutcome;
|
||||
typedef std::future<RecognizeIdentityCardOutcome> RecognizeIdentityCardOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeIdentityCardRequest&, const RecognizeIdentityCardOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeIdentityCardAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeLicensePlateResult> RecognizeLicensePlateOutcome;
|
||||
typedef std::future<RecognizeLicensePlateOutcome> RecognizeLicensePlateOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeLicensePlateRequest&, const RecognizeLicensePlateOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeLicensePlateAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizePassportMRZResult> RecognizePassportMRZOutcome;
|
||||
typedef std::future<RecognizePassportMRZOutcome> RecognizePassportMRZOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizePassportMRZRequest&, const RecognizePassportMRZOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizePassportMRZAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeQrCodeResult> RecognizeQrCodeOutcome;
|
||||
typedef std::future<RecognizeQrCodeOutcome> RecognizeQrCodeOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeQrCodeRequest&, const RecognizeQrCodeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeQrCodeAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeStampResult> RecognizeStampOutcome;
|
||||
typedef std::future<RecognizeStampOutcome> RecognizeStampOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeStampRequest&, const RecognizeStampOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeStampAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeTableResult> RecognizeTableOutcome;
|
||||
typedef std::future<RecognizeTableOutcome> RecognizeTableOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeTableRequest&, const RecognizeTableOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeTableAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeTakeoutOrderResult> RecognizeTakeoutOrderOutcome;
|
||||
typedef std::future<RecognizeTakeoutOrderOutcome> RecognizeTakeoutOrderOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeTakeoutOrderRequest&, const RecognizeTakeoutOrderOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeTakeoutOrderAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeTaxiInvoiceResult> RecognizeTaxiInvoiceOutcome;
|
||||
typedef std::future<RecognizeTaxiInvoiceOutcome> RecognizeTaxiInvoiceOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeTaxiInvoiceRequest&, const RecognizeTaxiInvoiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeTaxiInvoiceAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeTrainTicketResult> RecognizeTrainTicketOutcome;
|
||||
typedef std::future<RecognizeTrainTicketOutcome> RecognizeTrainTicketOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeTrainTicketRequest&, const RecognizeTrainTicketOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeTrainTicketAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeVATInvoiceResult> RecognizeVATInvoiceOutcome;
|
||||
typedef std::future<RecognizeVATInvoiceOutcome> RecognizeVATInvoiceOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeVATInvoiceRequest&, const RecognizeVATInvoiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeVATInvoiceAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeVINCodeResult> RecognizeVINCodeOutcome;
|
||||
typedef std::future<RecognizeVINCodeOutcome> RecognizeVINCodeOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeVINCodeRequest&, const RecognizeVINCodeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeVINCodeAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeVerificationcodeResult> RecognizeVerificationcodeOutcome;
|
||||
typedef std::future<RecognizeVerificationcodeOutcome> RecognizeVerificationcodeOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeVerificationcodeRequest&, const RecognizeVerificationcodeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeVerificationcodeAsyncHandler;
|
||||
typedef Outcome<Error, Model::TrimDocumentResult> TrimDocumentOutcome;
|
||||
typedef std::future<TrimDocumentOutcome> TrimDocumentOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::TrimDocumentRequest&, const TrimDocumentOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TrimDocumentAsyncHandler;
|
||||
|
||||
OcrClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
OcrClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
OcrClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~OcrClient();
|
||||
GetAsyncJobResultOutcome getAsyncJobResult(const Model::GetAsyncJobResultRequest &request)const;
|
||||
void getAsyncJobResultAsync(const Model::GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetAsyncJobResultOutcomeCallable getAsyncJobResultCallable(const Model::GetAsyncJobResultRequest& request) const;
|
||||
RecognizeAccountPageOutcome recognizeAccountPage(const Model::RecognizeAccountPageRequest &request)const;
|
||||
void recognizeAccountPageAsync(const Model::RecognizeAccountPageRequest& request, const RecognizeAccountPageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeAccountPageOutcomeCallable recognizeAccountPageCallable(const Model::RecognizeAccountPageRequest& request) const;
|
||||
RecognizeBankCardOutcome recognizeBankCard(const Model::RecognizeBankCardRequest &request)const;
|
||||
void recognizeBankCardAsync(const Model::RecognizeBankCardRequest& request, const RecognizeBankCardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeBankCardOutcomeCallable recognizeBankCardCallable(const Model::RecognizeBankCardRequest& request) const;
|
||||
RecognizeBusinessCardOutcome recognizeBusinessCard(const Model::RecognizeBusinessCardRequest &request)const;
|
||||
void recognizeBusinessCardAsync(const Model::RecognizeBusinessCardRequest& request, const RecognizeBusinessCardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeBusinessCardOutcomeCallable recognizeBusinessCardCallable(const Model::RecognizeBusinessCardRequest& request) const;
|
||||
RecognizeBusinessLicenseOutcome recognizeBusinessLicense(const Model::RecognizeBusinessLicenseRequest &request)const;
|
||||
void recognizeBusinessLicenseAsync(const Model::RecognizeBusinessLicenseRequest& request, const RecognizeBusinessLicenseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeBusinessLicenseOutcomeCallable recognizeBusinessLicenseCallable(const Model::RecognizeBusinessLicenseRequest& request) const;
|
||||
RecognizeCharacterOutcome recognizeCharacter(const Model::RecognizeCharacterRequest &request)const;
|
||||
void recognizeCharacterAsync(const Model::RecognizeCharacterRequest& request, const RecognizeCharacterAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeCharacterOutcomeCallable recognizeCharacterCallable(const Model::RecognizeCharacterRequest& request) const;
|
||||
RecognizeChinapassportOutcome recognizeChinapassport(const Model::RecognizeChinapassportRequest &request)const;
|
||||
void recognizeChinapassportAsync(const Model::RecognizeChinapassportRequest& request, const RecognizeChinapassportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeChinapassportOutcomeCallable recognizeChinapassportCallable(const Model::RecognizeChinapassportRequest& request) const;
|
||||
RecognizeDriverLicenseOutcome recognizeDriverLicense(const Model::RecognizeDriverLicenseRequest &request)const;
|
||||
void recognizeDriverLicenseAsync(const Model::RecognizeDriverLicenseRequest& request, const RecognizeDriverLicenseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeDriverLicenseOutcomeCallable recognizeDriverLicenseCallable(const Model::RecognizeDriverLicenseRequest& request) const;
|
||||
RecognizeDrivingLicenseOutcome recognizeDrivingLicense(const Model::RecognizeDrivingLicenseRequest &request)const;
|
||||
void recognizeDrivingLicenseAsync(const Model::RecognizeDrivingLicenseRequest& request, const RecognizeDrivingLicenseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeDrivingLicenseOutcomeCallable recognizeDrivingLicenseCallable(const Model::RecognizeDrivingLicenseRequest& request) const;
|
||||
RecognizeIdentityCardOutcome recognizeIdentityCard(const Model::RecognizeIdentityCardRequest &request)const;
|
||||
void recognizeIdentityCardAsync(const Model::RecognizeIdentityCardRequest& request, const RecognizeIdentityCardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeIdentityCardOutcomeCallable recognizeIdentityCardCallable(const Model::RecognizeIdentityCardRequest& request) const;
|
||||
RecognizeLicensePlateOutcome recognizeLicensePlate(const Model::RecognizeLicensePlateRequest &request)const;
|
||||
void recognizeLicensePlateAsync(const Model::RecognizeLicensePlateRequest& request, const RecognizeLicensePlateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeLicensePlateOutcomeCallable recognizeLicensePlateCallable(const Model::RecognizeLicensePlateRequest& request) const;
|
||||
RecognizePassportMRZOutcome recognizePassportMRZ(const Model::RecognizePassportMRZRequest &request)const;
|
||||
void recognizePassportMRZAsync(const Model::RecognizePassportMRZRequest& request, const RecognizePassportMRZAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizePassportMRZOutcomeCallable recognizePassportMRZCallable(const Model::RecognizePassportMRZRequest& request) const;
|
||||
RecognizeQrCodeOutcome recognizeQrCode(const Model::RecognizeQrCodeRequest &request)const;
|
||||
void recognizeQrCodeAsync(const Model::RecognizeQrCodeRequest& request, const RecognizeQrCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeQrCodeOutcomeCallable recognizeQrCodeCallable(const Model::RecognizeQrCodeRequest& request) const;
|
||||
RecognizeStampOutcome recognizeStamp(const Model::RecognizeStampRequest &request)const;
|
||||
void recognizeStampAsync(const Model::RecognizeStampRequest& request, const RecognizeStampAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeStampOutcomeCallable recognizeStampCallable(const Model::RecognizeStampRequest& request) const;
|
||||
RecognizeTableOutcome recognizeTable(const Model::RecognizeTableRequest &request)const;
|
||||
void recognizeTableAsync(const Model::RecognizeTableRequest& request, const RecognizeTableAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeTableOutcomeCallable recognizeTableCallable(const Model::RecognizeTableRequest& request) const;
|
||||
RecognizeTakeoutOrderOutcome recognizeTakeoutOrder(const Model::RecognizeTakeoutOrderRequest &request)const;
|
||||
void recognizeTakeoutOrderAsync(const Model::RecognizeTakeoutOrderRequest& request, const RecognizeTakeoutOrderAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeTakeoutOrderOutcomeCallable recognizeTakeoutOrderCallable(const Model::RecognizeTakeoutOrderRequest& request) const;
|
||||
RecognizeTaxiInvoiceOutcome recognizeTaxiInvoice(const Model::RecognizeTaxiInvoiceRequest &request)const;
|
||||
void recognizeTaxiInvoiceAsync(const Model::RecognizeTaxiInvoiceRequest& request, const RecognizeTaxiInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeTaxiInvoiceOutcomeCallable recognizeTaxiInvoiceCallable(const Model::RecognizeTaxiInvoiceRequest& request) const;
|
||||
RecognizeTrainTicketOutcome recognizeTrainTicket(const Model::RecognizeTrainTicketRequest &request)const;
|
||||
void recognizeTrainTicketAsync(const Model::RecognizeTrainTicketRequest& request, const RecognizeTrainTicketAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeTrainTicketOutcomeCallable recognizeTrainTicketCallable(const Model::RecognizeTrainTicketRequest& request) const;
|
||||
RecognizeVATInvoiceOutcome recognizeVATInvoice(const Model::RecognizeVATInvoiceRequest &request)const;
|
||||
void recognizeVATInvoiceAsync(const Model::RecognizeVATInvoiceRequest& request, const RecognizeVATInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeVATInvoiceOutcomeCallable recognizeVATInvoiceCallable(const Model::RecognizeVATInvoiceRequest& request) const;
|
||||
RecognizeVINCodeOutcome recognizeVINCode(const Model::RecognizeVINCodeRequest &request)const;
|
||||
void recognizeVINCodeAsync(const Model::RecognizeVINCodeRequest& request, const RecognizeVINCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeVINCodeOutcomeCallable recognizeVINCodeCallable(const Model::RecognizeVINCodeRequest& request) const;
|
||||
RecognizeVerificationcodeOutcome recognizeVerificationcode(const Model::RecognizeVerificationcodeRequest &request)const;
|
||||
void recognizeVerificationcodeAsync(const Model::RecognizeVerificationcodeRequest& request, const RecognizeVerificationcodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeVerificationcodeOutcomeCallable recognizeVerificationcodeCallable(const Model::RecognizeVerificationcodeRequest& request) const;
|
||||
TrimDocumentOutcome trimDocument(const Model::TrimDocumentRequest &request)const;
|
||||
void trimDocumentAsync(const Model::TrimDocumentRequest& request, const TrimDocumentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TrimDocumentOutcomeCallable trimDocumentCallable(const Model::TrimDocumentRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_OCR_OCRCLIENT_H_
|
||||
32
ocr/include/alibabacloud/ocr/OcrExport.h
Normal file
32
ocr/include/alibabacloud/ocr/OcrExport.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_OCREXPORT_H_
|
||||
#define ALIBABACLOUD_OCR_OCREXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_OCR_LIBRARY)
|
||||
# define ALIBABACLOUD_OCR_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_OCR_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_OCR_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_OCR_OCREXPORT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT GetAsyncJobResultRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetAsyncJobResultRequest();
|
||||
~GetAsyncJobResultRequest();
|
||||
|
||||
bool getAsync()const;
|
||||
void setAsync(bool async);
|
||||
std::string getJobId()const;
|
||||
void setJobId(const std::string& jobId);
|
||||
|
||||
private:
|
||||
bool async_;
|
||||
std::string jobId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTREQUEST_H_
|
||||
59
ocr/include/alibabacloud/ocr/model/GetAsyncJobResultResult.h
Normal file
59
ocr/include/alibabacloud/ocr/model/GetAsyncJobResultResult.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT GetAsyncJobResultResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string status;
|
||||
std::string errorCode;
|
||||
std::string errorMessage;
|
||||
std::string jobId;
|
||||
std::string result;
|
||||
};
|
||||
|
||||
|
||||
GetAsyncJobResultResult();
|
||||
explicit GetAsyncJobResultResult(const std::string &payload);
|
||||
~GetAsyncJobResultResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_GETASYNCJOBRESULTRESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeAccountPageRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeAccountPageRequest();
|
||||
~RecognizeAccountPageRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGEREQUEST_H_
|
||||
103
ocr/include/alibabacloud/ocr/model/RecognizeAccountPageResult.h
Normal file
103
ocr/include/alibabacloud/ocr/model/RecognizeAccountPageResult.h
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeAccountPageResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct TitleArea
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct InvalidStampArea
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct UndertakeStampArea
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct RegisterStampArea
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct OtherStampArea
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
std::string nativePlace;
|
||||
std::vector<OtherStampArea> otherStampAreas;
|
||||
std::string birthPlace;
|
||||
std::vector<RegisterStampArea> registerStampAreas;
|
||||
std::string gender;
|
||||
std::vector<InvalidStampArea> invalidStampAreas;
|
||||
std::string nationality;
|
||||
std::string name;
|
||||
std::vector<UndertakeStampArea> undertakeStampAreas;
|
||||
std::string relation;
|
||||
float angle;
|
||||
TitleArea titleArea;
|
||||
std::string birthDate;
|
||||
std::string iDNumber;
|
||||
};
|
||||
|
||||
|
||||
RecognizeAccountPageResult();
|
||||
explicit RecognizeAccountPageResult(const std::string &payload);
|
||||
~RecognizeAccountPageResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEACCOUNTPAGERESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeBankCardRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeBankCardRequest();
|
||||
~RecognizeBankCardRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDREQUEST_H_
|
||||
57
ocr/include/alibabacloud/ocr/model/RecognizeBankCardResult.h
Normal file
57
ocr/include/alibabacloud/ocr/model/RecognizeBankCardResult.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeBankCardResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string bankName;
|
||||
std::string cardNumber;
|
||||
std::string validDate;
|
||||
};
|
||||
|
||||
|
||||
RecognizeBankCardResult();
|
||||
explicit RecognizeBankCardResult(const std::string &payload);
|
||||
~RecognizeBankCardResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBANKCARDRESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessCardRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeBusinessCardRequest();
|
||||
~RecognizeBusinessCardRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDREQUEST_H_
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessCardResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::vector<std::string> addresses;
|
||||
std::vector<std::string> departments;
|
||||
std::vector<std::string> companies;
|
||||
std::vector<std::string> emails;
|
||||
std::vector<std::string> officePhoneNumbers;
|
||||
std::vector<std::string> cellPhoneNumbers;
|
||||
std::vector<std::string> titles;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
|
||||
RecognizeBusinessCardResult();
|
||||
explicit RecognizeBusinessCardResult(const std::string &payload);
|
||||
~RecognizeBusinessCardResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSCARDRESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessLicenseRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeBusinessLicenseRequest();
|
||||
~RecognizeBusinessLicenseRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSEREQUEST_H_
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeBusinessLicenseResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Emblem
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct Title
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct Stamp
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct QRCode
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
Stamp stamp;
|
||||
std::string validPeriod;
|
||||
std::string address;
|
||||
Title title;
|
||||
std::string capital;
|
||||
std::string legalPerson;
|
||||
std::string establishDate;
|
||||
std::string name;
|
||||
std::string registerNumber;
|
||||
QRCode qRCode;
|
||||
std::string type;
|
||||
std::string angle;
|
||||
Emblem emblem;
|
||||
std::string business;
|
||||
};
|
||||
|
||||
|
||||
RecognizeBusinessLicenseResult();
|
||||
explicit RecognizeBusinessLicenseResult(const std::string &payload);
|
||||
~RecognizeBusinessLicenseResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEBUSINESSLICENSERESULT_H_
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeCharacterRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeCharacterRequest();
|
||||
~RecognizeCharacterRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
bool getOutputProbability()const;
|
||||
void setOutputProbability(bool outputProbability);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
int getMinHeight()const;
|
||||
void setMinHeight(int minHeight);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
bool outputProbability_;
|
||||
std::string imageURL_;
|
||||
int minHeight_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERREQUEST_H_
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeCharacterResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Result
|
||||
{
|
||||
struct TextRectangles
|
||||
{
|
||||
int left;
|
||||
int angle;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
TextRectangles textRectangles;
|
||||
float probability;
|
||||
std::string text;
|
||||
};
|
||||
std::vector<Result> results;
|
||||
};
|
||||
|
||||
|
||||
RecognizeCharacterResult();
|
||||
explicit RecognizeCharacterResult(const std::string &payload);
|
||||
~RecognizeCharacterResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHARACTERRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeChinapassportRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeChinapassportRequest();
|
||||
~RecognizeChinapassportRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTREQUEST_H_
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeChinapassportResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string expiryDate;
|
||||
std::string sourceCountry;
|
||||
std::string birthPlace;
|
||||
std::string issuePlaceRaw;
|
||||
std::string nameChineseRaw;
|
||||
std::string authority;
|
||||
std::string sex;
|
||||
std::string issueDate;
|
||||
std::string birthDay;
|
||||
std::string lineZero;
|
||||
std::string issuePlace;
|
||||
std::string expiryDay;
|
||||
bool success;
|
||||
std::string name;
|
||||
std::string lineOne;
|
||||
std::string nameChinese;
|
||||
std::string type;
|
||||
std::string personId;
|
||||
std::string passportNo;
|
||||
std::string birthPlaceRaw;
|
||||
std::string country;
|
||||
std::string birthDate;
|
||||
};
|
||||
|
||||
|
||||
RecognizeChinapassportResult();
|
||||
explicit RecognizeChinapassportResult(const std::string &payload);
|
||||
~RecognizeChinapassportResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZECHINAPASSPORTRESULT_H_
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeDriverLicenseRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeDriverLicenseRequest();
|
||||
~RecognizeDriverLicenseRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getSide()const;
|
||||
void setSide(const std::string& side);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string side_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSEREQUEST_H_
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeDriverLicenseResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct FaceResult
|
||||
{
|
||||
std::string startDate;
|
||||
std::string address;
|
||||
std::string licenseNumber;
|
||||
std::string vehicleType;
|
||||
std::string issueDate;
|
||||
std::string gender;
|
||||
std::string endDate;
|
||||
std::string name;
|
||||
};
|
||||
struct BackResult
|
||||
{
|
||||
std::string archiveNumber;
|
||||
};
|
||||
FaceResult faceResult;
|
||||
BackResult backResult;
|
||||
};
|
||||
|
||||
|
||||
RecognizeDriverLicenseResult();
|
||||
explicit RecognizeDriverLicenseResult(const std::string &payload);
|
||||
~RecognizeDriverLicenseResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVERLICENSERESULT_H_
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeDrivingLicenseRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeDrivingLicenseRequest();
|
||||
~RecognizeDrivingLicenseRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getSide()const;
|
||||
void setSide(const std::string& side);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string side_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSEREQUEST_H_
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeDrivingLicenseResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct FaceResult
|
||||
{
|
||||
std::string plateNumber;
|
||||
std::string owner;
|
||||
std::string engineNumber;
|
||||
std::string address;
|
||||
std::string vehicleType;
|
||||
std::string model;
|
||||
std::string registerDate;
|
||||
std::string issueDate;
|
||||
std::string vin;
|
||||
std::string useCharacter;
|
||||
};
|
||||
struct BackResult
|
||||
{
|
||||
std::string approvedPassengerCapacity;
|
||||
std::string grossMass;
|
||||
std::string plateNumber;
|
||||
std::string energyType;
|
||||
std::string tractionMass;
|
||||
std::string approvedLoad;
|
||||
std::string inspectionRecord;
|
||||
std::string unladenMass;
|
||||
std::string fileNumber;
|
||||
std::string overallDimension;
|
||||
};
|
||||
FaceResult faceResult;
|
||||
BackResult backResult;
|
||||
};
|
||||
|
||||
|
||||
RecognizeDrivingLicenseResult();
|
||||
explicit RecognizeDrivingLicenseResult(const std::string &payload);
|
||||
~RecognizeDrivingLicenseResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEDRIVINGLICENSERESULT_H_
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeIdentityCardRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeIdentityCardRequest();
|
||||
~RecognizeIdentityCardRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getSide()const;
|
||||
void setSide(const std::string& side);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string side_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDREQUEST_H_
|
||||
100
ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h
Normal file
100
ocr/include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeIdentityCardResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct FrontResult
|
||||
{
|
||||
struct FaceRectangle
|
||||
{
|
||||
struct Center
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
struct Size
|
||||
{
|
||||
float height;
|
||||
float width;
|
||||
};
|
||||
Center center;
|
||||
float angle;
|
||||
Size size;
|
||||
};
|
||||
struct CardArea
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
struct FaceRectVertice
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
std::string address;
|
||||
FaceRectangle faceRectangle;
|
||||
std::vector<FaceRectVertice> faceRectVertices;
|
||||
std::vector<CardArea> cardAreas;
|
||||
std::string gender;
|
||||
std::string nationality;
|
||||
std::string name;
|
||||
std::string iDNumber;
|
||||
std::string birthDate;
|
||||
};
|
||||
struct BackResult
|
||||
{
|
||||
std::string startDate;
|
||||
std::string issue;
|
||||
std::string endDate;
|
||||
};
|
||||
FrontResult frontResult;
|
||||
BackResult backResult;
|
||||
};
|
||||
|
||||
|
||||
RecognizeIdentityCardResult();
|
||||
explicit RecognizeIdentityCardResult(const std::string &payload);
|
||||
~RecognizeIdentityCardResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEIDENTITYCARDRESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeLicensePlateRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeLicensePlateRequest();
|
||||
~RecognizeLicensePlateRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATEREQUEST_H_
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeLicensePlateResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Plate
|
||||
{
|
||||
struct Roi
|
||||
{
|
||||
int w;
|
||||
int h;
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
std::string plateNumber;
|
||||
float confidence;
|
||||
std::string plateType;
|
||||
float plateTypeConfidence;
|
||||
Roi roi;
|
||||
};
|
||||
std::vector<Plate> plates;
|
||||
};
|
||||
|
||||
|
||||
RecognizeLicensePlateResult();
|
||||
explicit RecognizeLicensePlateResult(const std::string &payload);
|
||||
~RecognizeLicensePlateResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZELICENSEPLATERESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizePassportMRZRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizePassportMRZRequest();
|
||||
~RecognizePassportMRZRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZREQUEST_H_
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizePassportMRZResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Region
|
||||
{
|
||||
std::string content;
|
||||
float recognitionScore;
|
||||
std::vector<std::string> bandBoxes;
|
||||
std::string name;
|
||||
float detectionScore;
|
||||
};
|
||||
std::vector<Region> regions;
|
||||
};
|
||||
|
||||
|
||||
RecognizePassportMRZResult();
|
||||
explicit RecognizePassportMRZResult(const std::string &payload);
|
||||
~RecognizePassportMRZResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEPASSPORTMRZRESULT_H_
|
||||
53
ocr/include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h
Normal file
53
ocr/include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeQrCodeRequest : public RpcServiceRequest
|
||||
{
|
||||
public:
|
||||
struct Tasks
|
||||
{
|
||||
std::string imageURL;
|
||||
};
|
||||
|
||||
public:
|
||||
RecognizeQrCodeRequest();
|
||||
~RecognizeQrCodeRequest();
|
||||
|
||||
std::vector<Tasks> getTasks()const;
|
||||
void setTasks(const std::vector<Tasks>& tasks);
|
||||
|
||||
private:
|
||||
std::vector<Tasks> tasks_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODEREQUEST_H_
|
||||
68
ocr/include/alibabacloud/ocr/model/RecognizeQrCodeResult.h
Normal file
68
ocr/include/alibabacloud/ocr/model/RecognizeQrCodeResult.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeQrCodeResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
struct Result
|
||||
{
|
||||
std::string suggestion;
|
||||
float rate;
|
||||
std::vector<std::string> qrCodesData;
|
||||
std::string label;
|
||||
};
|
||||
std::string taskId;
|
||||
std::vector<Element::Result> results;
|
||||
std::string imageURL;
|
||||
};
|
||||
std::vector<Element> elements;
|
||||
};
|
||||
|
||||
|
||||
RecognizeQrCodeResult();
|
||||
explicit RecognizeQrCodeResult(const std::string &payload);
|
||||
~RecognizeQrCodeResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEQRCODERESULT_H_
|
||||
51
ocr/include/alibabacloud/ocr/model/RecognizeStampRequest.h
Normal file
51
ocr/include/alibabacloud/ocr/model/RecognizeStampRequest.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeStampRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeStampRequest();
|
||||
~RecognizeStampRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPREQUEST_H_
|
||||
78
ocr/include/alibabacloud/ocr/model/RecognizeStampResult.h
Normal file
78
ocr/include/alibabacloud/ocr/model/RecognizeStampResult.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeStampResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct ResultsItem
|
||||
{
|
||||
struct Roi
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
struct Text
|
||||
{
|
||||
float confidence;
|
||||
std::string content;
|
||||
};
|
||||
struct GeneralTextItem
|
||||
{
|
||||
float confidence;
|
||||
std::string content;
|
||||
};
|
||||
Text text;
|
||||
Roi roi;
|
||||
std::vector<ResultsItem::GeneralTextItem> generalText;
|
||||
};
|
||||
std::vector<ResultsItem> results;
|
||||
};
|
||||
|
||||
|
||||
RecognizeStampResult();
|
||||
explicit RecognizeStampResult(const std::string &payload);
|
||||
~RecognizeStampResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZESTAMPRESULT_H_
|
||||
66
ocr/include/alibabacloud/ocr/model/RecognizeTableRequest.h
Normal file
66
ocr/include/alibabacloud/ocr/model/RecognizeTableRequest.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTableRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeTableRequest();
|
||||
~RecognizeTableRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
bool getUseFinanceModel()const;
|
||||
void setUseFinanceModel(bool useFinanceModel);
|
||||
bool getSkipDetection()const;
|
||||
void setSkipDetection(bool skipDetection);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
std::string getOutputFormat()const;
|
||||
void setOutputFormat(const std::string& outputFormat);
|
||||
bool getAssureDirection()const;
|
||||
void setAssureDirection(bool assureDirection);
|
||||
bool getHasLine()const;
|
||||
void setHasLine(bool hasLine);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
bool useFinanceModel_;
|
||||
bool skipDetection_;
|
||||
std::string imageURL_;
|
||||
std::string outputFormat_;
|
||||
bool assureDirection_;
|
||||
bool hasLine_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLEREQUEST_H_
|
||||
76
ocr/include/alibabacloud/ocr/model/RecognizeTableResult.h
Normal file
76
ocr/include/alibabacloud/ocr/model/RecognizeTableResult.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTableResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Table
|
||||
{
|
||||
struct TableRow
|
||||
{
|
||||
struct TableColumn
|
||||
{
|
||||
int endRow;
|
||||
int endColumn;
|
||||
std::vector<std::string> texts;
|
||||
int height;
|
||||
int width;
|
||||
int startRow;
|
||||
int startColumn;
|
||||
};
|
||||
std::vector<TableRow::TableColumn> tableColumns;
|
||||
};
|
||||
std::vector<std::string> head;
|
||||
std::vector<std::string> tail;
|
||||
std::vector<Table::TableRow> tableRows;
|
||||
};
|
||||
std::string fileContent;
|
||||
std::vector<Table> tables;
|
||||
};
|
||||
|
||||
|
||||
RecognizeTableResult();
|
||||
explicit RecognizeTableResult(const std::string &payload);
|
||||
~RecognizeTableResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETABLERESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTakeoutOrderRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeTakeoutOrderRequest();
|
||||
~RecognizeTakeoutOrderRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERREQUEST_H_
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTakeoutOrderResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
float score;
|
||||
std::string value;
|
||||
std::string name;
|
||||
std::vector<std::string> boxes;
|
||||
};
|
||||
std::vector<Element> elements;
|
||||
};
|
||||
|
||||
|
||||
RecognizeTakeoutOrderResult();
|
||||
explicit RecognizeTakeoutOrderResult(const std::string &payload);
|
||||
~RecognizeTakeoutOrderResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAKEOUTORDERRESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTaxiInvoiceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeTaxiInvoiceRequest();
|
||||
~RecognizeTaxiInvoiceRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICEREQUEST_H_
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTaxiInvoiceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Invoice
|
||||
{
|
||||
struct InvoiceRoi
|
||||
{
|
||||
float w;
|
||||
float h;
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
struct Item
|
||||
{
|
||||
struct ItemRoi
|
||||
{
|
||||
struct Center
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
struct Size
|
||||
{
|
||||
float w;
|
||||
float h;
|
||||
};
|
||||
Center center;
|
||||
float angle;
|
||||
Size size;
|
||||
};
|
||||
ItemRoi itemRoi;
|
||||
std::string text;
|
||||
};
|
||||
int rotateType;
|
||||
InvoiceRoi invoiceRoi;
|
||||
std::vector<Invoice::Item> items;
|
||||
};
|
||||
std::vector<Invoice> invoices;
|
||||
};
|
||||
|
||||
|
||||
RecognizeTaxiInvoiceResult();
|
||||
explicit RecognizeTaxiInvoiceResult(const std::string &payload);
|
||||
~RecognizeTaxiInvoiceResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETAXIINVOICERESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTrainTicketRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeTrainTicketRequest();
|
||||
~RecognizeTrainTicketRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETREQUEST_H_
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTrainTicketResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string destination;
|
||||
std::string seat;
|
||||
std::string number;
|
||||
float price;
|
||||
std::string level;
|
||||
std::string date;
|
||||
std::string name;
|
||||
std::string departureStation;
|
||||
};
|
||||
|
||||
|
||||
RecognizeTrainTicketResult();
|
||||
explicit RecognizeTrainTicketResult(const std::string &payload);
|
||||
~RecognizeTrainTicketResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETRAINTICKETRESULT_H_
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeVATInvoiceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeVATInvoiceRequest();
|
||||
~RecognizeVATInvoiceRequest();
|
||||
|
||||
std::string getFileType()const;
|
||||
void setFileType(const std::string& fileType);
|
||||
std::string getFileURL()const;
|
||||
void setFileURL(const std::string& fileURL);
|
||||
|
||||
private:
|
||||
std::string fileType_;
|
||||
std::string fileURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICEREQUEST_H_
|
||||
100
ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h
Normal file
100
ocr/include/alibabacloud/ocr/model/RecognizeVATInvoiceResult.h
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeVATInvoiceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Content
|
||||
{
|
||||
std::string checker;
|
||||
std::string payeeAddress;
|
||||
std::string payeeName;
|
||||
std::string payerAddress;
|
||||
std::string antiFakeCode;
|
||||
std::string payerBankName;
|
||||
std::string invoiceNo;
|
||||
std::string payerRegisterNo;
|
||||
std::string payerName;
|
||||
std::string withoutTaxAmount;
|
||||
std::string invoiceAmount;
|
||||
std::string taxAmount;
|
||||
std::string payeeBankName;
|
||||
std::string clerk;
|
||||
std::string invoiceCode;
|
||||
std::string payeeRegisterNo;
|
||||
std::string invoiceDate;
|
||||
std::string sumAmount;
|
||||
std::string payee;
|
||||
};
|
||||
struct Box
|
||||
{
|
||||
std::vector<std::string> payerRegisterNoes;
|
||||
std::vector<std::string> payerAddresses;
|
||||
std::vector<std::string> invoiceAmounts;
|
||||
std::vector<std::string> invoiceDates;
|
||||
std::vector<std::string> payeeAddresses;
|
||||
std::vector<std::string> clerks;
|
||||
std::vector<std::string> withoutTaxAmounts;
|
||||
std::vector<std::string> checkers;
|
||||
std::vector<std::string> invoiceCodes;
|
||||
std::vector<std::string> taxAmounts;
|
||||
std::vector<std::string> sumAmounts;
|
||||
std::vector<std::string> payerNames;
|
||||
std::vector<std::string> invoiceFakeCodes;
|
||||
std::vector<std::string> payeeNames;
|
||||
std::vector<std::string> payeeBankNames;
|
||||
std::vector<std::string> payees;
|
||||
std::vector<std::string> invoiceNoes;
|
||||
std::vector<std::string> payerBankNames;
|
||||
std::vector<std::string> payeeRegisterNoes;
|
||||
};
|
||||
Content content;
|
||||
Box box;
|
||||
};
|
||||
|
||||
|
||||
RecognizeVATInvoiceResult();
|
||||
explicit RecognizeVATInvoiceResult(const std::string &payload);
|
||||
~RecognizeVATInvoiceResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVATINVOICERESULT_H_
|
||||
51
ocr/include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h
Normal file
51
ocr/include/alibabacloud/ocr/model/RecognizeVINCodeRequest.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeVINCodeRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeVINCodeRequest();
|
||||
~RecognizeVINCodeRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODEREQUEST_H_
|
||||
55
ocr/include/alibabacloud/ocr/model/RecognizeVINCodeResult.h
Normal file
55
ocr/include/alibabacloud/ocr/model/RecognizeVINCodeResult.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeVINCodeResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string vinCode;
|
||||
};
|
||||
|
||||
|
||||
RecognizeVINCodeResult();
|
||||
explicit RecognizeVINCodeResult(const std::string &payload);
|
||||
~RecognizeVINCodeResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVINCODERESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeVerificationcodeRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeVerificationcodeRequest();
|
||||
~RecognizeVerificationcodeRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODEREQUEST_H_
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeVerificationcodeResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string content;
|
||||
};
|
||||
|
||||
|
||||
RecognizeVerificationcodeResult();
|
||||
explicit RecognizeVerificationcodeResult(const std::string &payload);
|
||||
~RecognizeVerificationcodeResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEVERIFICATIONCODERESULT_H_
|
||||
57
ocr/include/alibabacloud/ocr/model/TrimDocumentRequest.h
Normal file
57
ocr/include/alibabacloud/ocr/model/TrimDocumentRequest.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT TrimDocumentRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
TrimDocumentRequest();
|
||||
~TrimDocumentRequest();
|
||||
|
||||
std::string getFileType()const;
|
||||
void setFileType(const std::string& fileType);
|
||||
bool getAsync()const;
|
||||
void setAsync(bool async);
|
||||
std::string getFileURL()const;
|
||||
void setFileURL(const std::string& fileURL);
|
||||
std::string getOutputType()const;
|
||||
void setOutputType(const std::string& outputType);
|
||||
|
||||
private:
|
||||
std::string fileType_;
|
||||
bool async_;
|
||||
std::string fileURL_;
|
||||
std::string outputType_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTREQUEST_H_
|
||||
55
ocr/include/alibabacloud/ocr/model/TrimDocumentResult.h
Normal file
55
ocr/include/alibabacloud/ocr/model/TrimDocumentResult.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT TrimDocumentResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string content;
|
||||
};
|
||||
|
||||
|
||||
TrimDocumentResult();
|
||||
explicit TrimDocumentResult(const std::string &payload);
|
||||
~TrimDocumentResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_TRIMDOCUMENTRESULT_H_
|
||||
845
ocr/src/OcrClient.cc
Normal file
845
ocr/src/OcrClient.cc
Normal file
@@ -0,0 +1,845 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/OcrClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "ocr";
|
||||
}
|
||||
|
||||
OcrClient::OcrClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ocr");
|
||||
}
|
||||
|
||||
OcrClient::OcrClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ocr");
|
||||
}
|
||||
|
||||
OcrClient::OcrClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ocr");
|
||||
}
|
||||
|
||||
OcrClient::~OcrClient()
|
||||
{}
|
||||
|
||||
OcrClient::GetAsyncJobResultOutcome OcrClient::getAsyncJobResult(const GetAsyncJobResultRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetAsyncJobResultOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetAsyncJobResultOutcome(GetAsyncJobResultResult(outcome.result()));
|
||||
else
|
||||
return GetAsyncJobResultOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::getAsyncJobResultAsync(const GetAsyncJobResultRequest& request, const GetAsyncJobResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getAsyncJobResult(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::GetAsyncJobResultOutcomeCallable OcrClient::getAsyncJobResultCallable(const GetAsyncJobResultRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetAsyncJobResultOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getAsyncJobResult(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeAccountPageOutcome OcrClient::recognizeAccountPage(const RecognizeAccountPageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeAccountPageOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeAccountPageOutcome(RecognizeAccountPageResult(outcome.result()));
|
||||
else
|
||||
return RecognizeAccountPageOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeAccountPageAsync(const RecognizeAccountPageRequest& request, const RecognizeAccountPageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeAccountPage(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeAccountPageOutcomeCallable OcrClient::recognizeAccountPageCallable(const RecognizeAccountPageRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeAccountPageOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeAccountPage(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeBankCardOutcome OcrClient::recognizeBankCard(const RecognizeBankCardRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeBankCardOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeBankCardOutcome(RecognizeBankCardResult(outcome.result()));
|
||||
else
|
||||
return RecognizeBankCardOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeBankCardAsync(const RecognizeBankCardRequest& request, const RecognizeBankCardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeBankCard(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeBankCardOutcomeCallable OcrClient::recognizeBankCardCallable(const RecognizeBankCardRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeBankCardOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeBankCard(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeBusinessCardOutcome OcrClient::recognizeBusinessCard(const RecognizeBusinessCardRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeBusinessCardOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeBusinessCardOutcome(RecognizeBusinessCardResult(outcome.result()));
|
||||
else
|
||||
return RecognizeBusinessCardOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeBusinessCardAsync(const RecognizeBusinessCardRequest& request, const RecognizeBusinessCardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeBusinessCard(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeBusinessCardOutcomeCallable OcrClient::recognizeBusinessCardCallable(const RecognizeBusinessCardRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeBusinessCardOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeBusinessCard(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeBusinessLicenseOutcome OcrClient::recognizeBusinessLicense(const RecognizeBusinessLicenseRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeBusinessLicenseOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeBusinessLicenseOutcome(RecognizeBusinessLicenseResult(outcome.result()));
|
||||
else
|
||||
return RecognizeBusinessLicenseOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeBusinessLicenseAsync(const RecognizeBusinessLicenseRequest& request, const RecognizeBusinessLicenseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeBusinessLicense(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeBusinessLicenseOutcomeCallable OcrClient::recognizeBusinessLicenseCallable(const RecognizeBusinessLicenseRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeBusinessLicenseOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeBusinessLicense(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeCharacterOutcome OcrClient::recognizeCharacter(const RecognizeCharacterRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeCharacterOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeCharacterOutcome(RecognizeCharacterResult(outcome.result()));
|
||||
else
|
||||
return RecognizeCharacterOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeCharacterAsync(const RecognizeCharacterRequest& request, const RecognizeCharacterAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeCharacter(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeCharacterOutcomeCallable OcrClient::recognizeCharacterCallable(const RecognizeCharacterRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeCharacterOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeCharacter(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeChinapassportOutcome OcrClient::recognizeChinapassport(const RecognizeChinapassportRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeChinapassportOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeChinapassportOutcome(RecognizeChinapassportResult(outcome.result()));
|
||||
else
|
||||
return RecognizeChinapassportOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeChinapassportAsync(const RecognizeChinapassportRequest& request, const RecognizeChinapassportAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeChinapassport(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeChinapassportOutcomeCallable OcrClient::recognizeChinapassportCallable(const RecognizeChinapassportRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeChinapassportOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeChinapassport(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeDriverLicenseOutcome OcrClient::recognizeDriverLicense(const RecognizeDriverLicenseRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeDriverLicenseOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeDriverLicenseOutcome(RecognizeDriverLicenseResult(outcome.result()));
|
||||
else
|
||||
return RecognizeDriverLicenseOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeDriverLicenseAsync(const RecognizeDriverLicenseRequest& request, const RecognizeDriverLicenseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeDriverLicense(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeDriverLicenseOutcomeCallable OcrClient::recognizeDriverLicenseCallable(const RecognizeDriverLicenseRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeDriverLicenseOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeDriverLicense(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeDrivingLicenseOutcome OcrClient::recognizeDrivingLicense(const RecognizeDrivingLicenseRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeDrivingLicenseOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeDrivingLicenseOutcome(RecognizeDrivingLicenseResult(outcome.result()));
|
||||
else
|
||||
return RecognizeDrivingLicenseOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeDrivingLicenseAsync(const RecognizeDrivingLicenseRequest& request, const RecognizeDrivingLicenseAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeDrivingLicense(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeDrivingLicenseOutcomeCallable OcrClient::recognizeDrivingLicenseCallable(const RecognizeDrivingLicenseRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeDrivingLicenseOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeDrivingLicense(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeIdentityCardOutcome OcrClient::recognizeIdentityCard(const RecognizeIdentityCardRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeIdentityCardOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeIdentityCardOutcome(RecognizeIdentityCardResult(outcome.result()));
|
||||
else
|
||||
return RecognizeIdentityCardOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeIdentityCardAsync(const RecognizeIdentityCardRequest& request, const RecognizeIdentityCardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeIdentityCard(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeIdentityCardOutcomeCallable OcrClient::recognizeIdentityCardCallable(const RecognizeIdentityCardRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeIdentityCardOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeIdentityCard(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeLicensePlateOutcome OcrClient::recognizeLicensePlate(const RecognizeLicensePlateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeLicensePlateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeLicensePlateOutcome(RecognizeLicensePlateResult(outcome.result()));
|
||||
else
|
||||
return RecognizeLicensePlateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeLicensePlateAsync(const RecognizeLicensePlateRequest& request, const RecognizeLicensePlateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeLicensePlate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeLicensePlateOutcomeCallable OcrClient::recognizeLicensePlateCallable(const RecognizeLicensePlateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeLicensePlateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeLicensePlate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizePassportMRZOutcome OcrClient::recognizePassportMRZ(const RecognizePassportMRZRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizePassportMRZOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizePassportMRZOutcome(RecognizePassportMRZResult(outcome.result()));
|
||||
else
|
||||
return RecognizePassportMRZOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizePassportMRZAsync(const RecognizePassportMRZRequest& request, const RecognizePassportMRZAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizePassportMRZ(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizePassportMRZOutcomeCallable OcrClient::recognizePassportMRZCallable(const RecognizePassportMRZRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizePassportMRZOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizePassportMRZ(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeQrCodeOutcome OcrClient::recognizeQrCode(const RecognizeQrCodeRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeQrCodeOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeQrCodeOutcome(RecognizeQrCodeResult(outcome.result()));
|
||||
else
|
||||
return RecognizeQrCodeOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeQrCodeAsync(const RecognizeQrCodeRequest& request, const RecognizeQrCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeQrCode(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeQrCodeOutcomeCallable OcrClient::recognizeQrCodeCallable(const RecognizeQrCodeRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeQrCodeOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeQrCode(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeStampOutcome OcrClient::recognizeStamp(const RecognizeStampRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeStampOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeStampOutcome(RecognizeStampResult(outcome.result()));
|
||||
else
|
||||
return RecognizeStampOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeStampAsync(const RecognizeStampRequest& request, const RecognizeStampAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeStamp(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeStampOutcomeCallable OcrClient::recognizeStampCallable(const RecognizeStampRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeStampOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeStamp(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTableOutcome OcrClient::recognizeTable(const RecognizeTableRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeTableOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeTableOutcome(RecognizeTableResult(outcome.result()));
|
||||
else
|
||||
return RecognizeTableOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeTableAsync(const RecognizeTableRequest& request, const RecognizeTableAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeTable(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTableOutcomeCallable OcrClient::recognizeTableCallable(const RecognizeTableRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeTableOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeTable(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTakeoutOrderOutcome OcrClient::recognizeTakeoutOrder(const RecognizeTakeoutOrderRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeTakeoutOrderOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeTakeoutOrderOutcome(RecognizeTakeoutOrderResult(outcome.result()));
|
||||
else
|
||||
return RecognizeTakeoutOrderOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeTakeoutOrderAsync(const RecognizeTakeoutOrderRequest& request, const RecognizeTakeoutOrderAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeTakeoutOrder(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTakeoutOrderOutcomeCallable OcrClient::recognizeTakeoutOrderCallable(const RecognizeTakeoutOrderRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeTakeoutOrderOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeTakeoutOrder(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTaxiInvoiceOutcome OcrClient::recognizeTaxiInvoice(const RecognizeTaxiInvoiceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeTaxiInvoiceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeTaxiInvoiceOutcome(RecognizeTaxiInvoiceResult(outcome.result()));
|
||||
else
|
||||
return RecognizeTaxiInvoiceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeTaxiInvoiceAsync(const RecognizeTaxiInvoiceRequest& request, const RecognizeTaxiInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeTaxiInvoice(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTaxiInvoiceOutcomeCallable OcrClient::recognizeTaxiInvoiceCallable(const RecognizeTaxiInvoiceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeTaxiInvoiceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeTaxiInvoice(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTrainTicketOutcome OcrClient::recognizeTrainTicket(const RecognizeTrainTicketRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeTrainTicketOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeTrainTicketOutcome(RecognizeTrainTicketResult(outcome.result()));
|
||||
else
|
||||
return RecognizeTrainTicketOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeTrainTicketAsync(const RecognizeTrainTicketRequest& request, const RecognizeTrainTicketAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeTrainTicket(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTrainTicketOutcomeCallable OcrClient::recognizeTrainTicketCallable(const RecognizeTrainTicketRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeTrainTicketOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeTrainTicket(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeVATInvoiceOutcome OcrClient::recognizeVATInvoice(const RecognizeVATInvoiceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeVATInvoiceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeVATInvoiceOutcome(RecognizeVATInvoiceResult(outcome.result()));
|
||||
else
|
||||
return RecognizeVATInvoiceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeVATInvoiceAsync(const RecognizeVATInvoiceRequest& request, const RecognizeVATInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeVATInvoice(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeVATInvoiceOutcomeCallable OcrClient::recognizeVATInvoiceCallable(const RecognizeVATInvoiceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeVATInvoiceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeVATInvoice(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeVINCodeOutcome OcrClient::recognizeVINCode(const RecognizeVINCodeRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeVINCodeOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeVINCodeOutcome(RecognizeVINCodeResult(outcome.result()));
|
||||
else
|
||||
return RecognizeVINCodeOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeVINCodeAsync(const RecognizeVINCodeRequest& request, const RecognizeVINCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeVINCode(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeVINCodeOutcomeCallable OcrClient::recognizeVINCodeCallable(const RecognizeVINCodeRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeVINCodeOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeVINCode(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeVerificationcodeOutcome OcrClient::recognizeVerificationcode(const RecognizeVerificationcodeRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeVerificationcodeOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeVerificationcodeOutcome(RecognizeVerificationcodeResult(outcome.result()));
|
||||
else
|
||||
return RecognizeVerificationcodeOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeVerificationcodeAsync(const RecognizeVerificationcodeRequest& request, const RecognizeVerificationcodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeVerificationcode(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeVerificationcodeOutcomeCallable OcrClient::recognizeVerificationcodeCallable(const RecognizeVerificationcodeRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeVerificationcodeOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeVerificationcode(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::TrimDocumentOutcome OcrClient::trimDocument(const TrimDocumentRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return TrimDocumentOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return TrimDocumentOutcome(TrimDocumentResult(outcome.result()));
|
||||
else
|
||||
return TrimDocumentOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::trimDocumentAsync(const TrimDocumentRequest& request, const TrimDocumentAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, trimDocument(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::TrimDocumentOutcomeCallable OcrClient::trimDocumentCallable(const TrimDocumentRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<TrimDocumentOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->trimDocument(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
51
ocr/src/model/GetAsyncJobResultRequest.cc
Normal file
51
ocr/src/model/GetAsyncJobResultRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/GetAsyncJobResultRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::GetAsyncJobResultRequest;
|
||||
|
||||
GetAsyncJobResultRequest::GetAsyncJobResultRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "GetAsyncJobResult")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetAsyncJobResultRequest::~GetAsyncJobResultRequest()
|
||||
{}
|
||||
|
||||
bool GetAsyncJobResultRequest::getAsync()const
|
||||
{
|
||||
return async_;
|
||||
}
|
||||
|
||||
void GetAsyncJobResultRequest::setAsync(bool async)
|
||||
{
|
||||
async_ = async;
|
||||
setBodyParameter("Async", async ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string GetAsyncJobResultRequest::getJobId()const
|
||||
{
|
||||
return jobId_;
|
||||
}
|
||||
|
||||
void GetAsyncJobResultRequest::setJobId(const std::string& jobId)
|
||||
{
|
||||
jobId_ = jobId;
|
||||
setBodyParameter("JobId", jobId);
|
||||
}
|
||||
|
||||
60
ocr/src/model/GetAsyncJobResultResult.cc
Normal file
60
ocr/src/model/GetAsyncJobResultResult.cc
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/GetAsyncJobResultResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
GetAsyncJobResultResult::GetAsyncJobResultResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetAsyncJobResultResult::GetAsyncJobResultResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetAsyncJobResultResult::~GetAsyncJobResultResult()
|
||||
{}
|
||||
|
||||
void GetAsyncJobResultResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["ErrorCode"].isNull())
|
||||
data_.errorCode = dataNode["ErrorCode"].asString();
|
||||
if(!dataNode["ErrorMessage"].isNull())
|
||||
data_.errorMessage = dataNode["ErrorMessage"].asString();
|
||||
if(!dataNode["JobId"].isNull())
|
||||
data_.jobId = dataNode["JobId"].asString();
|
||||
if(!dataNode["Result"].isNull())
|
||||
data_.result = dataNode["Result"].asString();
|
||||
if(!dataNode["Status"].isNull())
|
||||
data_.status = dataNode["Status"].asString();
|
||||
|
||||
}
|
||||
|
||||
GetAsyncJobResultResult::Data GetAsyncJobResultResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeAccountPageRequest.cc
Normal file
51
ocr/src/model/RecognizeAccountPageRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeAccountPageRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeAccountPageRequest;
|
||||
|
||||
RecognizeAccountPageRequest::RecognizeAccountPageRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeAccountPage")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeAccountPageRequest::~RecognizeAccountPageRequest()
|
||||
{}
|
||||
|
||||
int RecognizeAccountPageRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeAccountPageRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeAccountPageRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeAccountPageRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
133
ocr/src/model/RecognizeAccountPageResult.cc
Normal file
133
ocr/src/model/RecognizeAccountPageResult.cc
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeAccountPageResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeAccountPageResult::RecognizeAccountPageResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeAccountPageResult::RecognizeAccountPageResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeAccountPageResult::~RecognizeAccountPageResult()
|
||||
{}
|
||||
|
||||
void RecognizeAccountPageResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Angle"].isNull())
|
||||
data_.angle = std::stof(dataNode["Angle"].asString());
|
||||
if(!dataNode["Name"].isNull())
|
||||
data_.name = dataNode["Name"].asString();
|
||||
if(!dataNode["Gender"].isNull())
|
||||
data_.gender = dataNode["Gender"].asString();
|
||||
if(!dataNode["Relation"].isNull())
|
||||
data_.relation = dataNode["Relation"].asString();
|
||||
if(!dataNode["BirthPlace"].isNull())
|
||||
data_.birthPlace = dataNode["BirthPlace"].asString();
|
||||
if(!dataNode["Nationality"].isNull())
|
||||
data_.nationality = dataNode["Nationality"].asString();
|
||||
if(!dataNode["NativePlace"].isNull())
|
||||
data_.nativePlace = dataNode["NativePlace"].asString();
|
||||
if(!dataNode["BirthDate"].isNull())
|
||||
data_.birthDate = dataNode["BirthDate"].asString();
|
||||
if(!dataNode["IDNumber"].isNull())
|
||||
data_.iDNumber = dataNode["IDNumber"].asString();
|
||||
auto allInvalidStampAreasNode = dataNode["InvalidStampAreas"]["InvalidStampArea"];
|
||||
for (auto dataNodeInvalidStampAreasInvalidStampArea : allInvalidStampAreasNode)
|
||||
{
|
||||
Data::InvalidStampArea invalidStampAreaObject;
|
||||
if(!dataNodeInvalidStampAreasInvalidStampArea["Left"].isNull())
|
||||
invalidStampAreaObject.left = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Left"].asString());
|
||||
if(!dataNodeInvalidStampAreasInvalidStampArea["Top"].isNull())
|
||||
invalidStampAreaObject.top = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Top"].asString());
|
||||
if(!dataNodeInvalidStampAreasInvalidStampArea["Height"].isNull())
|
||||
invalidStampAreaObject.height = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Height"].asString());
|
||||
if(!dataNodeInvalidStampAreasInvalidStampArea["Width"].isNull())
|
||||
invalidStampAreaObject.width = std::stoi(dataNodeInvalidStampAreasInvalidStampArea["Width"].asString());
|
||||
data_.invalidStampAreas.push_back(invalidStampAreaObject);
|
||||
}
|
||||
auto allUndertakeStampAreasNode = dataNode["UndertakeStampAreas"]["UndertakeStampArea"];
|
||||
for (auto dataNodeUndertakeStampAreasUndertakeStampArea : allUndertakeStampAreasNode)
|
||||
{
|
||||
Data::UndertakeStampArea undertakeStampAreaObject;
|
||||
if(!dataNodeUndertakeStampAreasUndertakeStampArea["Left"].isNull())
|
||||
undertakeStampAreaObject.left = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Left"].asString());
|
||||
if(!dataNodeUndertakeStampAreasUndertakeStampArea["Top"].isNull())
|
||||
undertakeStampAreaObject.top = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Top"].asString());
|
||||
if(!dataNodeUndertakeStampAreasUndertakeStampArea["Height"].isNull())
|
||||
undertakeStampAreaObject.height = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Height"].asString());
|
||||
if(!dataNodeUndertakeStampAreasUndertakeStampArea["Width"].isNull())
|
||||
undertakeStampAreaObject.width = std::stoi(dataNodeUndertakeStampAreasUndertakeStampArea["Width"].asString());
|
||||
data_.undertakeStampAreas.push_back(undertakeStampAreaObject);
|
||||
}
|
||||
auto allRegisterStampAreasNode = dataNode["RegisterStampAreas"]["RegisterStampArea"];
|
||||
for (auto dataNodeRegisterStampAreasRegisterStampArea : allRegisterStampAreasNode)
|
||||
{
|
||||
Data::RegisterStampArea registerStampAreaObject;
|
||||
if(!dataNodeRegisterStampAreasRegisterStampArea["Left"].isNull())
|
||||
registerStampAreaObject.left = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Left"].asString());
|
||||
if(!dataNodeRegisterStampAreasRegisterStampArea["Top"].isNull())
|
||||
registerStampAreaObject.top = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Top"].asString());
|
||||
if(!dataNodeRegisterStampAreasRegisterStampArea["Height"].isNull())
|
||||
registerStampAreaObject.height = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Height"].asString());
|
||||
if(!dataNodeRegisterStampAreasRegisterStampArea["Width"].isNull())
|
||||
registerStampAreaObject.width = std::stoi(dataNodeRegisterStampAreasRegisterStampArea["Width"].asString());
|
||||
data_.registerStampAreas.push_back(registerStampAreaObject);
|
||||
}
|
||||
auto allOtherStampAreasNode = dataNode["OtherStampAreas"]["OtherStampArea"];
|
||||
for (auto dataNodeOtherStampAreasOtherStampArea : allOtherStampAreasNode)
|
||||
{
|
||||
Data::OtherStampArea otherStampAreaObject;
|
||||
if(!dataNodeOtherStampAreasOtherStampArea["Left"].isNull())
|
||||
otherStampAreaObject.left = std::stoi(dataNodeOtherStampAreasOtherStampArea["Left"].asString());
|
||||
if(!dataNodeOtherStampAreasOtherStampArea["Top"].isNull())
|
||||
otherStampAreaObject.top = std::stoi(dataNodeOtherStampAreasOtherStampArea["Top"].asString());
|
||||
if(!dataNodeOtherStampAreasOtherStampArea["Height"].isNull())
|
||||
otherStampAreaObject.height = std::stoi(dataNodeOtherStampAreasOtherStampArea["Height"].asString());
|
||||
if(!dataNodeOtherStampAreasOtherStampArea["Width"].isNull())
|
||||
otherStampAreaObject.width = std::stoi(dataNodeOtherStampAreasOtherStampArea["Width"].asString());
|
||||
data_.otherStampAreas.push_back(otherStampAreaObject);
|
||||
}
|
||||
auto titleAreaNode = dataNode["TitleArea"];
|
||||
if(!titleAreaNode["Left"].isNull())
|
||||
data_.titleArea.left = std::stoi(titleAreaNode["Left"].asString());
|
||||
if(!titleAreaNode["Top"].isNull())
|
||||
data_.titleArea.top = std::stoi(titleAreaNode["Top"].asString());
|
||||
if(!titleAreaNode["Height"].isNull())
|
||||
data_.titleArea.height = std::stoi(titleAreaNode["Height"].asString());
|
||||
if(!titleAreaNode["Width"].isNull())
|
||||
data_.titleArea.width = std::stoi(titleAreaNode["Width"].asString());
|
||||
|
||||
}
|
||||
|
||||
RecognizeAccountPageResult::Data RecognizeAccountPageResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeBankCardRequest.cc
Normal file
51
ocr/src/model/RecognizeBankCardRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeBankCardRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeBankCardRequest;
|
||||
|
||||
RecognizeBankCardRequest::RecognizeBankCardRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeBankCard")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeBankCardRequest::~RecognizeBankCardRequest()
|
||||
{}
|
||||
|
||||
int RecognizeBankCardRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeBankCardRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeBankCardRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeBankCardRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
56
ocr/src/model/RecognizeBankCardResult.cc
Normal file
56
ocr/src/model/RecognizeBankCardResult.cc
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeBankCardResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeBankCardResult::RecognizeBankCardResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeBankCardResult::RecognizeBankCardResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeBankCardResult::~RecognizeBankCardResult()
|
||||
{}
|
||||
|
||||
void RecognizeBankCardResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["BankName"].isNull())
|
||||
data_.bankName = dataNode["BankName"].asString();
|
||||
if(!dataNode["CardNumber"].isNull())
|
||||
data_.cardNumber = dataNode["CardNumber"].asString();
|
||||
if(!dataNode["ValidDate"].isNull())
|
||||
data_.validDate = dataNode["ValidDate"].asString();
|
||||
|
||||
}
|
||||
|
||||
RecognizeBankCardResult::Data RecognizeBankCardResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeBusinessCardRequest.cc
Normal file
51
ocr/src/model/RecognizeBusinessCardRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeBusinessCardRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeBusinessCardRequest;
|
||||
|
||||
RecognizeBusinessCardRequest::RecognizeBusinessCardRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeBusinessCard")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeBusinessCardRequest::~RecognizeBusinessCardRequest()
|
||||
{}
|
||||
|
||||
int RecognizeBusinessCardRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeBusinessCardRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeBusinessCardRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeBusinessCardRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
73
ocr/src/model/RecognizeBusinessCardResult.cc
Normal file
73
ocr/src/model/RecognizeBusinessCardResult.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeBusinessCardResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeBusinessCardResult::RecognizeBusinessCardResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeBusinessCardResult::RecognizeBusinessCardResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeBusinessCardResult::~RecognizeBusinessCardResult()
|
||||
{}
|
||||
|
||||
void RecognizeBusinessCardResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Name"].isNull())
|
||||
data_.name = dataNode["Name"].asString();
|
||||
auto allCompanies = dataNode["Companies"]["Company"];
|
||||
for (auto value : allCompanies)
|
||||
data_.companies.push_back(value.asString());
|
||||
auto allDepartments = dataNode["Departments"]["Department"];
|
||||
for (auto value : allDepartments)
|
||||
data_.departments.push_back(value.asString());
|
||||
auto allTitles = dataNode["Titles"]["Title"];
|
||||
for (auto value : allTitles)
|
||||
data_.titles.push_back(value.asString());
|
||||
auto allCellPhoneNumbers = dataNode["CellPhoneNumbers"]["CellPhoneNumber"];
|
||||
for (auto value : allCellPhoneNumbers)
|
||||
data_.cellPhoneNumbers.push_back(value.asString());
|
||||
auto allOfficePhoneNumbers = dataNode["OfficePhoneNumbers"]["OfficePhoneNumber"];
|
||||
for (auto value : allOfficePhoneNumbers)
|
||||
data_.officePhoneNumbers.push_back(value.asString());
|
||||
auto allAddresses = dataNode["Addresses"]["Address"];
|
||||
for (auto value : allAddresses)
|
||||
data_.addresses.push_back(value.asString());
|
||||
auto allEmails = dataNode["Emails"]["Email"];
|
||||
for (auto value : allEmails)
|
||||
data_.emails.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
RecognizeBusinessCardResult::Data RecognizeBusinessCardResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeBusinessLicenseRequest.cc
Normal file
51
ocr/src/model/RecognizeBusinessLicenseRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeBusinessLicenseRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeBusinessLicenseRequest;
|
||||
|
||||
RecognizeBusinessLicenseRequest::RecognizeBusinessLicenseRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeBusinessLicense")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeBusinessLicenseRequest::~RecognizeBusinessLicenseRequest()
|
||||
{}
|
||||
|
||||
int RecognizeBusinessLicenseRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeBusinessLicenseRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeBusinessLicenseRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeBusinessLicenseRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
106
ocr/src/model/RecognizeBusinessLicenseResult.cc
Normal file
106
ocr/src/model/RecognizeBusinessLicenseResult.cc
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeBusinessLicenseResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeBusinessLicenseResult::RecognizeBusinessLicenseResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeBusinessLicenseResult::RecognizeBusinessLicenseResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeBusinessLicenseResult::~RecognizeBusinessLicenseResult()
|
||||
{}
|
||||
|
||||
void RecognizeBusinessLicenseResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Angle"].isNull())
|
||||
data_.angle = dataNode["Angle"].asString();
|
||||
if(!dataNode["RegisterNumber"].isNull())
|
||||
data_.registerNumber = dataNode["RegisterNumber"].asString();
|
||||
if(!dataNode["Name"].isNull())
|
||||
data_.name = dataNode["Name"].asString();
|
||||
if(!dataNode["Type"].isNull())
|
||||
data_.type = dataNode["Type"].asString();
|
||||
if(!dataNode["LegalPerson"].isNull())
|
||||
data_.legalPerson = dataNode["LegalPerson"].asString();
|
||||
if(!dataNode["EstablishDate"].isNull())
|
||||
data_.establishDate = dataNode["EstablishDate"].asString();
|
||||
if(!dataNode["ValidPeriod"].isNull())
|
||||
data_.validPeriod = dataNode["ValidPeriod"].asString();
|
||||
if(!dataNode["Address"].isNull())
|
||||
data_.address = dataNode["Address"].asString();
|
||||
if(!dataNode["Capital"].isNull())
|
||||
data_.capital = dataNode["Capital"].asString();
|
||||
if(!dataNode["Business"].isNull())
|
||||
data_.business = dataNode["Business"].asString();
|
||||
auto emblemNode = dataNode["Emblem"];
|
||||
if(!emblemNode["Top"].isNull())
|
||||
data_.emblem.top = std::stoi(emblemNode["Top"].asString());
|
||||
if(!emblemNode["Left"].isNull())
|
||||
data_.emblem.left = std::stoi(emblemNode["Left"].asString());
|
||||
if(!emblemNode["Height"].isNull())
|
||||
data_.emblem.height = std::stoi(emblemNode["Height"].asString());
|
||||
if(!emblemNode["Width"].isNull())
|
||||
data_.emblem.width = std::stoi(emblemNode["Width"].asString());
|
||||
auto titleNode = dataNode["Title"];
|
||||
if(!titleNode["Top"].isNull())
|
||||
data_.title.top = std::stoi(titleNode["Top"].asString());
|
||||
if(!titleNode["Left"].isNull())
|
||||
data_.title.left = std::stoi(titleNode["Left"].asString());
|
||||
if(!titleNode["Height"].isNull())
|
||||
data_.title.height = std::stoi(titleNode["Height"].asString());
|
||||
if(!titleNode["Width"].isNull())
|
||||
data_.title.width = std::stoi(titleNode["Width"].asString());
|
||||
auto stampNode = dataNode["Stamp"];
|
||||
if(!stampNode["Top"].isNull())
|
||||
data_.stamp.top = std::stoi(stampNode["Top"].asString());
|
||||
if(!stampNode["Left"].isNull())
|
||||
data_.stamp.left = std::stoi(stampNode["Left"].asString());
|
||||
if(!stampNode["Height"].isNull())
|
||||
data_.stamp.height = std::stoi(stampNode["Height"].asString());
|
||||
if(!stampNode["Width"].isNull())
|
||||
data_.stamp.width = std::stoi(stampNode["Width"].asString());
|
||||
auto qRCodeNode = dataNode["QRCode"];
|
||||
if(!qRCodeNode["Top"].isNull())
|
||||
data_.qRCode.top = std::stoi(qRCodeNode["Top"].asString());
|
||||
if(!qRCodeNode["Left"].isNull())
|
||||
data_.qRCode.left = std::stoi(qRCodeNode["Left"].asString());
|
||||
if(!qRCodeNode["Height"].isNull())
|
||||
data_.qRCode.height = std::stoi(qRCodeNode["Height"].asString());
|
||||
if(!qRCodeNode["Width"].isNull())
|
||||
data_.qRCode.width = std::stoi(qRCodeNode["Width"].asString());
|
||||
|
||||
}
|
||||
|
||||
RecognizeBusinessLicenseResult::Data RecognizeBusinessLicenseResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
73
ocr/src/model/RecognizeCharacterRequest.cc
Normal file
73
ocr/src/model/RecognizeCharacterRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeCharacterRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeCharacterRequest;
|
||||
|
||||
RecognizeCharacterRequest::RecognizeCharacterRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeCharacter")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeCharacterRequest::~RecognizeCharacterRequest()
|
||||
{}
|
||||
|
||||
int RecognizeCharacterRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeCharacterRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
bool RecognizeCharacterRequest::getOutputProbability()const
|
||||
{
|
||||
return outputProbability_;
|
||||
}
|
||||
|
||||
void RecognizeCharacterRequest::setOutputProbability(bool outputProbability)
|
||||
{
|
||||
outputProbability_ = outputProbability;
|
||||
setBodyParameter("OutputProbability", outputProbability ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string RecognizeCharacterRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeCharacterRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
int RecognizeCharacterRequest::getMinHeight()const
|
||||
{
|
||||
return minHeight_;
|
||||
}
|
||||
|
||||
void RecognizeCharacterRequest::setMinHeight(int minHeight)
|
||||
{
|
||||
minHeight_ = minHeight;
|
||||
setBodyParameter("MinHeight", std::to_string(minHeight));
|
||||
}
|
||||
|
||||
71
ocr/src/model/RecognizeCharacterResult.cc
Normal file
71
ocr/src/model/RecognizeCharacterResult.cc
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeCharacterResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeCharacterResult::RecognizeCharacterResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeCharacterResult::RecognizeCharacterResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeCharacterResult::~RecognizeCharacterResult()
|
||||
{}
|
||||
|
||||
void RecognizeCharacterResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allResultsNode = dataNode["Results"]["Result"];
|
||||
for (auto dataNodeResultsResult : allResultsNode)
|
||||
{
|
||||
Data::Result resultObject;
|
||||
if(!dataNodeResultsResult["Probability"].isNull())
|
||||
resultObject.probability = std::stof(dataNodeResultsResult["Probability"].asString());
|
||||
if(!dataNodeResultsResult["Text"].isNull())
|
||||
resultObject.text = dataNodeResultsResult["Text"].asString();
|
||||
auto textRectanglesNode = value["TextRectangles"];
|
||||
if(!textRectanglesNode["Angle"].isNull())
|
||||
resultObject.textRectangles.angle = std::stoi(textRectanglesNode["Angle"].asString());
|
||||
if(!textRectanglesNode["Left"].isNull())
|
||||
resultObject.textRectangles.left = std::stoi(textRectanglesNode["Left"].asString());
|
||||
if(!textRectanglesNode["Top"].isNull())
|
||||
resultObject.textRectangles.top = std::stoi(textRectanglesNode["Top"].asString());
|
||||
if(!textRectanglesNode["Width"].isNull())
|
||||
resultObject.textRectangles.width = std::stoi(textRectanglesNode["Width"].asString());
|
||||
if(!textRectanglesNode["Height"].isNull())
|
||||
resultObject.textRectangles.height = std::stoi(textRectanglesNode["Height"].asString());
|
||||
data_.results.push_back(resultObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeCharacterResult::Data RecognizeCharacterResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
ocr/src/model/RecognizeChinapassportRequest.cc
Normal file
40
ocr/src/model/RecognizeChinapassportRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeChinapassportRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeChinapassportRequest;
|
||||
|
||||
RecognizeChinapassportRequest::RecognizeChinapassportRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeChinapassport")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeChinapassportRequest::~RecognizeChinapassportRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeChinapassportRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeChinapassportRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
94
ocr/src/model/RecognizeChinapassportResult.cc
Normal file
94
ocr/src/model/RecognizeChinapassportResult.cc
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeChinapassportResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeChinapassportResult::RecognizeChinapassportResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeChinapassportResult::RecognizeChinapassportResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeChinapassportResult::~RecognizeChinapassportResult()
|
||||
{}
|
||||
|
||||
void RecognizeChinapassportResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Authority"].isNull())
|
||||
data_.authority = dataNode["Authority"].asString();
|
||||
if(!dataNode["BirthDate"].isNull())
|
||||
data_.birthDate = dataNode["BirthDate"].asString();
|
||||
if(!dataNode["BirthDay"].isNull())
|
||||
data_.birthDay = dataNode["BirthDay"].asString();
|
||||
if(!dataNode["BirthPlace"].isNull())
|
||||
data_.birthPlace = dataNode["BirthPlace"].asString();
|
||||
if(!dataNode["BirthPlaceRaw"].isNull())
|
||||
data_.birthPlaceRaw = dataNode["BirthPlaceRaw"].asString();
|
||||
if(!dataNode["Country"].isNull())
|
||||
data_.country = dataNode["Country"].asString();
|
||||
if(!dataNode["ExpiryDate"].isNull())
|
||||
data_.expiryDate = dataNode["ExpiryDate"].asString();
|
||||
if(!dataNode["ExpiryDay"].isNull())
|
||||
data_.expiryDay = dataNode["ExpiryDay"].asString();
|
||||
if(!dataNode["IssueDate"].isNull())
|
||||
data_.issueDate = dataNode["IssueDate"].asString();
|
||||
if(!dataNode["IssuePlace"].isNull())
|
||||
data_.issuePlace = dataNode["IssuePlace"].asString();
|
||||
if(!dataNode["IssuePlaceRaw"].isNull())
|
||||
data_.issuePlaceRaw = dataNode["IssuePlaceRaw"].asString();
|
||||
if(!dataNode["LineZero"].isNull())
|
||||
data_.lineZero = dataNode["LineZero"].asString();
|
||||
if(!dataNode["LineOne"].isNull())
|
||||
data_.lineOne = dataNode["LineOne"].asString();
|
||||
if(!dataNode["Name"].isNull())
|
||||
data_.name = dataNode["Name"].asString();
|
||||
if(!dataNode["NameChinese"].isNull())
|
||||
data_.nameChinese = dataNode["NameChinese"].asString();
|
||||
if(!dataNode["NameChineseRaw"].isNull())
|
||||
data_.nameChineseRaw = dataNode["NameChineseRaw"].asString();
|
||||
if(!dataNode["PassportNo"].isNull())
|
||||
data_.passportNo = dataNode["PassportNo"].asString();
|
||||
if(!dataNode["PersonId"].isNull())
|
||||
data_.personId = dataNode["PersonId"].asString();
|
||||
if(!dataNode["Sex"].isNull())
|
||||
data_.sex = dataNode["Sex"].asString();
|
||||
if(!dataNode["SourceCountry"].isNull())
|
||||
data_.sourceCountry = dataNode["SourceCountry"].asString();
|
||||
if(!dataNode["Success"].isNull())
|
||||
data_.success = dataNode["Success"].asString() == "true";
|
||||
if(!dataNode["Type"].isNull())
|
||||
data_.type = dataNode["Type"].asString();
|
||||
|
||||
}
|
||||
|
||||
RecognizeChinapassportResult::Data RecognizeChinapassportResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
62
ocr/src/model/RecognizeDriverLicenseRequest.cc
Normal file
62
ocr/src/model/RecognizeDriverLicenseRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeDriverLicenseRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeDriverLicenseRequest;
|
||||
|
||||
RecognizeDriverLicenseRequest::RecognizeDriverLicenseRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeDriverLicense")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeDriverLicenseRequest::~RecognizeDriverLicenseRequest()
|
||||
{}
|
||||
|
||||
int RecognizeDriverLicenseRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeDriverLicenseRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeDriverLicenseRequest::getSide()const
|
||||
{
|
||||
return side_;
|
||||
}
|
||||
|
||||
void RecognizeDriverLicenseRequest::setSide(const std::string& side)
|
||||
{
|
||||
side_ = side;
|
||||
setBodyParameter("Side", side);
|
||||
}
|
||||
|
||||
std::string RecognizeDriverLicenseRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeDriverLicenseRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
70
ocr/src/model/RecognizeDriverLicenseResult.cc
Normal file
70
ocr/src/model/RecognizeDriverLicenseResult.cc
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeDriverLicenseResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeDriverLicenseResult::RecognizeDriverLicenseResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeDriverLicenseResult::RecognizeDriverLicenseResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeDriverLicenseResult::~RecognizeDriverLicenseResult()
|
||||
{}
|
||||
|
||||
void RecognizeDriverLicenseResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto faceResultNode = dataNode["FaceResult"];
|
||||
if(!faceResultNode["Name"].isNull())
|
||||
data_.faceResult.name = faceResultNode["Name"].asString();
|
||||
if(!faceResultNode["LicenseNumber"].isNull())
|
||||
data_.faceResult.licenseNumber = faceResultNode["LicenseNumber"].asString();
|
||||
if(!faceResultNode["VehicleType"].isNull())
|
||||
data_.faceResult.vehicleType = faceResultNode["VehicleType"].asString();
|
||||
if(!faceResultNode["StartDate"].isNull())
|
||||
data_.faceResult.startDate = faceResultNode["StartDate"].asString();
|
||||
if(!faceResultNode["EndDate"].isNull())
|
||||
data_.faceResult.endDate = faceResultNode["EndDate"].asString();
|
||||
if(!faceResultNode["IssueDate"].isNull())
|
||||
data_.faceResult.issueDate = faceResultNode["IssueDate"].asString();
|
||||
if(!faceResultNode["Address"].isNull())
|
||||
data_.faceResult.address = faceResultNode["Address"].asString();
|
||||
if(!faceResultNode["Gender"].isNull())
|
||||
data_.faceResult.gender = faceResultNode["Gender"].asString();
|
||||
auto backResultNode = dataNode["BackResult"];
|
||||
if(!backResultNode["ArchiveNumber"].isNull())
|
||||
data_.backResult.archiveNumber = backResultNode["ArchiveNumber"].asString();
|
||||
|
||||
}
|
||||
|
||||
RecognizeDriverLicenseResult::Data RecognizeDriverLicenseResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
62
ocr/src/model/RecognizeDrivingLicenseRequest.cc
Normal file
62
ocr/src/model/RecognizeDrivingLicenseRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeDrivingLicenseRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeDrivingLicenseRequest;
|
||||
|
||||
RecognizeDrivingLicenseRequest::RecognizeDrivingLicenseRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeDrivingLicense")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeDrivingLicenseRequest::~RecognizeDrivingLicenseRequest()
|
||||
{}
|
||||
|
||||
int RecognizeDrivingLicenseRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeDrivingLicenseRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeDrivingLicenseRequest::getSide()const
|
||||
{
|
||||
return side_;
|
||||
}
|
||||
|
||||
void RecognizeDrivingLicenseRequest::setSide(const std::string& side)
|
||||
{
|
||||
side_ = side;
|
||||
setBodyParameter("Side", side);
|
||||
}
|
||||
|
||||
std::string RecognizeDrivingLicenseRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeDrivingLicenseRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
92
ocr/src/model/RecognizeDrivingLicenseResult.cc
Normal file
92
ocr/src/model/RecognizeDrivingLicenseResult.cc
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeDrivingLicenseResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeDrivingLicenseResult::RecognizeDrivingLicenseResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeDrivingLicenseResult::RecognizeDrivingLicenseResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeDrivingLicenseResult::~RecognizeDrivingLicenseResult()
|
||||
{}
|
||||
|
||||
void RecognizeDrivingLicenseResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto faceResultNode = dataNode["FaceResult"];
|
||||
if(!faceResultNode["PlateNumber"].isNull())
|
||||
data_.faceResult.plateNumber = faceResultNode["PlateNumber"].asString();
|
||||
if(!faceResultNode["VehicleType"].isNull())
|
||||
data_.faceResult.vehicleType = faceResultNode["VehicleType"].asString();
|
||||
if(!faceResultNode["Owner"].isNull())
|
||||
data_.faceResult.owner = faceResultNode["Owner"].asString();
|
||||
if(!faceResultNode["UseCharacter"].isNull())
|
||||
data_.faceResult.useCharacter = faceResultNode["UseCharacter"].asString();
|
||||
if(!faceResultNode["Address"].isNull())
|
||||
data_.faceResult.address = faceResultNode["Address"].asString();
|
||||
if(!faceResultNode["Model"].isNull())
|
||||
data_.faceResult.model = faceResultNode["Model"].asString();
|
||||
if(!faceResultNode["Vin"].isNull())
|
||||
data_.faceResult.vin = faceResultNode["Vin"].asString();
|
||||
if(!faceResultNode["EngineNumber"].isNull())
|
||||
data_.faceResult.engineNumber = faceResultNode["EngineNumber"].asString();
|
||||
if(!faceResultNode["RegisterDate"].isNull())
|
||||
data_.faceResult.registerDate = faceResultNode["RegisterDate"].asString();
|
||||
if(!faceResultNode["IssueDate"].isNull())
|
||||
data_.faceResult.issueDate = faceResultNode["IssueDate"].asString();
|
||||
auto backResultNode = dataNode["BackResult"];
|
||||
if(!backResultNode["ApprovedPassengerCapacity"].isNull())
|
||||
data_.backResult.approvedPassengerCapacity = backResultNode["ApprovedPassengerCapacity"].asString();
|
||||
if(!backResultNode["ApprovedLoad"].isNull())
|
||||
data_.backResult.approvedLoad = backResultNode["ApprovedLoad"].asString();
|
||||
if(!backResultNode["FileNumber"].isNull())
|
||||
data_.backResult.fileNumber = backResultNode["FileNumber"].asString();
|
||||
if(!backResultNode["GrossMass"].isNull())
|
||||
data_.backResult.grossMass = backResultNode["GrossMass"].asString();
|
||||
if(!backResultNode["EnergyType"].isNull())
|
||||
data_.backResult.energyType = backResultNode["EnergyType"].asString();
|
||||
if(!backResultNode["InspectionRecord"].isNull())
|
||||
data_.backResult.inspectionRecord = backResultNode["InspectionRecord"].asString();
|
||||
if(!backResultNode["OverallDimension"].isNull())
|
||||
data_.backResult.overallDimension = backResultNode["OverallDimension"].asString();
|
||||
if(!backResultNode["TractionMass"].isNull())
|
||||
data_.backResult.tractionMass = backResultNode["TractionMass"].asString();
|
||||
if(!backResultNode["UnladenMass"].isNull())
|
||||
data_.backResult.unladenMass = backResultNode["UnladenMass"].asString();
|
||||
if(!backResultNode["PlateNumber"].isNull())
|
||||
data_.backResult.plateNumber = backResultNode["PlateNumber"].asString();
|
||||
|
||||
}
|
||||
|
||||
RecognizeDrivingLicenseResult::Data RecognizeDrivingLicenseResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
62
ocr/src/model/RecognizeIdentityCardRequest.cc
Normal file
62
ocr/src/model/RecognizeIdentityCardRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeIdentityCardRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeIdentityCardRequest;
|
||||
|
||||
RecognizeIdentityCardRequest::RecognizeIdentityCardRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeIdentityCard")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeIdentityCardRequest::~RecognizeIdentityCardRequest()
|
||||
{}
|
||||
|
||||
int RecognizeIdentityCardRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeIdentityCardRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeIdentityCardRequest::getSide()const
|
||||
{
|
||||
return side_;
|
||||
}
|
||||
|
||||
void RecognizeIdentityCardRequest::setSide(const std::string& side)
|
||||
{
|
||||
side_ = side;
|
||||
setBodyParameter("Side", side);
|
||||
}
|
||||
|
||||
std::string RecognizeIdentityCardRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeIdentityCardRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
103
ocr/src/model/RecognizeIdentityCardResult.cc
Normal file
103
ocr/src/model/RecognizeIdentityCardResult.cc
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeIdentityCardResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeIdentityCardResult::RecognizeIdentityCardResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeIdentityCardResult::RecognizeIdentityCardResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeIdentityCardResult::~RecognizeIdentityCardResult()
|
||||
{}
|
||||
|
||||
void RecognizeIdentityCardResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto frontResultNode = dataNode["FrontResult"];
|
||||
if(!frontResultNode["Address"].isNull())
|
||||
data_.frontResult.address = frontResultNode["Address"].asString();
|
||||
if(!frontResultNode["Name"].isNull())
|
||||
data_.frontResult.name = frontResultNode["Name"].asString();
|
||||
if(!frontResultNode["Nationality"].isNull())
|
||||
data_.frontResult.nationality = frontResultNode["Nationality"].asString();
|
||||
if(!frontResultNode["IDNumber"].isNull())
|
||||
data_.frontResult.iDNumber = frontResultNode["IDNumber"].asString();
|
||||
if(!frontResultNode["Gender"].isNull())
|
||||
data_.frontResult.gender = frontResultNode["Gender"].asString();
|
||||
if(!frontResultNode["BirthDate"].isNull())
|
||||
data_.frontResult.birthDate = frontResultNode["BirthDate"].asString();
|
||||
auto allCardAreasNode = frontResultNode["CardAreas"]["CardArea"];
|
||||
for (auto frontResultNodeCardAreasCardArea : allCardAreasNode)
|
||||
{
|
||||
Data::FrontResult::CardArea cardAreaObject;
|
||||
if(!frontResultNodeCardAreasCardArea["X"].isNull())
|
||||
cardAreaObject.x = std::stof(frontResultNodeCardAreasCardArea["X"].asString());
|
||||
if(!frontResultNodeCardAreasCardArea["Y"].isNull())
|
||||
cardAreaObject.y = std::stof(frontResultNodeCardAreasCardArea["Y"].asString());
|
||||
data_.frontResult.cardAreas.push_back(cardAreaObject);
|
||||
}
|
||||
auto allFaceRectVerticesNode = frontResultNode["FaceRectVertices"]["FaceRectVertice"];
|
||||
for (auto frontResultNodeFaceRectVerticesFaceRectVertice : allFaceRectVerticesNode)
|
||||
{
|
||||
Data::FrontResult::FaceRectVertice faceRectVerticeObject;
|
||||
if(!frontResultNodeFaceRectVerticesFaceRectVertice["X"].isNull())
|
||||
faceRectVerticeObject.x = std::stof(frontResultNodeFaceRectVerticesFaceRectVertice["X"].asString());
|
||||
if(!frontResultNodeFaceRectVerticesFaceRectVertice["Y"].isNull())
|
||||
faceRectVerticeObject.y = std::stof(frontResultNodeFaceRectVerticesFaceRectVertice["Y"].asString());
|
||||
data_.frontResult.faceRectVertices.push_back(faceRectVerticeObject);
|
||||
}
|
||||
auto faceRectangleNode = frontResultNode["FaceRectangle"];
|
||||
if(!faceRectangleNode["Angle"].isNull())
|
||||
data_.frontResult.faceRectangle.angle = std::stof(faceRectangleNode["Angle"].asString());
|
||||
auto centerNode = faceRectangleNode["Center"];
|
||||
if(!centerNode["X"].isNull())
|
||||
data_.frontResult.faceRectangle.center.x = std::stof(centerNode["X"].asString());
|
||||
if(!centerNode["Y"].isNull())
|
||||
data_.frontResult.faceRectangle.center.y = std::stof(centerNode["Y"].asString());
|
||||
auto sizeNode = faceRectangleNode["Size"];
|
||||
if(!sizeNode["Height"].isNull())
|
||||
data_.frontResult.faceRectangle.size.height = std::stof(sizeNode["Height"].asString());
|
||||
if(!sizeNode["Width"].isNull())
|
||||
data_.frontResult.faceRectangle.size.width = std::stof(sizeNode["Width"].asString());
|
||||
auto backResultNode = dataNode["BackResult"];
|
||||
if(!backResultNode["StartDate"].isNull())
|
||||
data_.backResult.startDate = backResultNode["StartDate"].asString();
|
||||
if(!backResultNode["EndDate"].isNull())
|
||||
data_.backResult.endDate = backResultNode["EndDate"].asString();
|
||||
if(!backResultNode["Issue"].isNull())
|
||||
data_.backResult.issue = backResultNode["Issue"].asString();
|
||||
|
||||
}
|
||||
|
||||
RecognizeIdentityCardResult::Data RecognizeIdentityCardResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeLicensePlateRequest.cc
Normal file
51
ocr/src/model/RecognizeLicensePlateRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeLicensePlateRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeLicensePlateRequest;
|
||||
|
||||
RecognizeLicensePlateRequest::RecognizeLicensePlateRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeLicensePlate")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeLicensePlateRequest::~RecognizeLicensePlateRequest()
|
||||
{}
|
||||
|
||||
int RecognizeLicensePlateRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeLicensePlateRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeLicensePlateRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeLicensePlateRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
73
ocr/src/model/RecognizeLicensePlateResult.cc
Normal file
73
ocr/src/model/RecognizeLicensePlateResult.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeLicensePlateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeLicensePlateResult::RecognizeLicensePlateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeLicensePlateResult::RecognizeLicensePlateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeLicensePlateResult::~RecognizeLicensePlateResult()
|
||||
{}
|
||||
|
||||
void RecognizeLicensePlateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allPlatesNode = dataNode["Plates"]["Plate"];
|
||||
for (auto dataNodePlatesPlate : allPlatesNode)
|
||||
{
|
||||
Data::Plate plateObject;
|
||||
if(!dataNodePlatesPlate["Confidence"].isNull())
|
||||
plateObject.confidence = std::stof(dataNodePlatesPlate["Confidence"].asString());
|
||||
if(!dataNodePlatesPlate["PlateNumber"].isNull())
|
||||
plateObject.plateNumber = dataNodePlatesPlate["PlateNumber"].asString();
|
||||
if(!dataNodePlatesPlate["PlateType"].isNull())
|
||||
plateObject.plateType = dataNodePlatesPlate["PlateType"].asString();
|
||||
if(!dataNodePlatesPlate["PlateTypeConfidence"].isNull())
|
||||
plateObject.plateTypeConfidence = std::stof(dataNodePlatesPlate["PlateTypeConfidence"].asString());
|
||||
auto roiNode = value["Roi"];
|
||||
if(!roiNode["H"].isNull())
|
||||
plateObject.roi.h = std::stoi(roiNode["H"].asString());
|
||||
if(!roiNode["W"].isNull())
|
||||
plateObject.roi.w = std::stoi(roiNode["W"].asString());
|
||||
if(!roiNode["X"].isNull())
|
||||
plateObject.roi.x = std::stoi(roiNode["X"].asString());
|
||||
if(!roiNode["Y"].isNull())
|
||||
plateObject.roi.y = std::stoi(roiNode["Y"].asString());
|
||||
data_.plates.push_back(plateObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeLicensePlateResult::Data RecognizeLicensePlateResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
ocr/src/model/RecognizePassportMRZRequest.cc
Normal file
40
ocr/src/model/RecognizePassportMRZRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizePassportMRZRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizePassportMRZRequest;
|
||||
|
||||
RecognizePassportMRZRequest::RecognizePassportMRZRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizePassportMRZ")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizePassportMRZRequest::~RecognizePassportMRZRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizePassportMRZRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizePassportMRZRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
67
ocr/src/model/RecognizePassportMRZResult.cc
Normal file
67
ocr/src/model/RecognizePassportMRZResult.cc
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizePassportMRZResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizePassportMRZResult::RecognizePassportMRZResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizePassportMRZResult::RecognizePassportMRZResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizePassportMRZResult::~RecognizePassportMRZResult()
|
||||
{}
|
||||
|
||||
void RecognizePassportMRZResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allRegionsNode = dataNode["Regions"]["Region"];
|
||||
for (auto dataNodeRegionsRegion : allRegionsNode)
|
||||
{
|
||||
Data::Region regionObject;
|
||||
if(!dataNodeRegionsRegion["Name"].isNull())
|
||||
regionObject.name = dataNodeRegionsRegion["Name"].asString();
|
||||
if(!dataNodeRegionsRegion["RecognitionScore"].isNull())
|
||||
regionObject.recognitionScore = std::stof(dataNodeRegionsRegion["RecognitionScore"].asString());
|
||||
if(!dataNodeRegionsRegion["Content"].isNull())
|
||||
regionObject.content = dataNodeRegionsRegion["Content"].asString();
|
||||
if(!dataNodeRegionsRegion["DetectionScore"].isNull())
|
||||
regionObject.detectionScore = std::stof(dataNodeRegionsRegion["DetectionScore"].asString());
|
||||
auto allBandBoxes = value["BandBoxes"]["BandBox"];
|
||||
for (auto value : allBandBoxes)
|
||||
regionObject.bandBoxes.push_back(value.asString());
|
||||
data_.regions.push_back(regionObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizePassportMRZResult::Data RecognizePassportMRZResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
44
ocr/src/model/RecognizeQrCodeRequest.cc
Normal file
44
ocr/src/model/RecognizeQrCodeRequest.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeQrCodeRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeQrCodeRequest;
|
||||
|
||||
RecognizeQrCodeRequest::RecognizeQrCodeRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeQrCode")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeQrCodeRequest::~RecognizeQrCodeRequest()
|
||||
{}
|
||||
|
||||
std::vector<RecognizeQrCodeRequest::Tasks> RecognizeQrCodeRequest::getTasks()const
|
||||
{
|
||||
return tasks_;
|
||||
}
|
||||
|
||||
void RecognizeQrCodeRequest::setTasks(const std::vector<Tasks>& tasks)
|
||||
{
|
||||
tasks_ = tasks;
|
||||
for(int dep1 = 0; dep1!= tasks.size(); dep1++) {
|
||||
auto tasksObj = tasks.at(dep1);
|
||||
std::string tasksObjStr = "Tasks." + std::to_string(dep1 + 1);
|
||||
setParameter(tasksObjStr + ".ImageURL", tasksObj.imageURL);
|
||||
}
|
||||
}
|
||||
|
||||
75
ocr/src/model/RecognizeQrCodeResult.cc
Normal file
75
ocr/src/model/RecognizeQrCodeResult.cc
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeQrCodeResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeQrCodeResult::RecognizeQrCodeResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeQrCodeResult::RecognizeQrCodeResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeQrCodeResult::~RecognizeQrCodeResult()
|
||||
{}
|
||||
|
||||
void RecognizeQrCodeResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["TaskId"].isNull())
|
||||
elementObject.taskId = dataNodeElementsElement["TaskId"].asString();
|
||||
if(!dataNodeElementsElement["ImageURL"].isNull())
|
||||
elementObject.imageURL = dataNodeElementsElement["ImageURL"].asString();
|
||||
auto allResultsNode = allElementsNode["Results"]["Result"];
|
||||
for (auto allElementsNodeResultsResult : allResultsNode)
|
||||
{
|
||||
Data::Element::Result resultsObject;
|
||||
if(!allElementsNodeResultsResult["Label"].isNull())
|
||||
resultsObject.label = allElementsNodeResultsResult["Label"].asString();
|
||||
if(!allElementsNodeResultsResult["Suggestion"].isNull())
|
||||
resultsObject.suggestion = allElementsNodeResultsResult["Suggestion"].asString();
|
||||
if(!allElementsNodeResultsResult["Rate"].isNull())
|
||||
resultsObject.rate = std::stof(allElementsNodeResultsResult["Rate"].asString());
|
||||
auto allQrCodesData = value["QrCodesData"]["QrCodeData"];
|
||||
for (auto value : allQrCodesData)
|
||||
resultsObject.qrCodesData.push_back(value.asString());
|
||||
elementObject.results.push_back(resultsObject);
|
||||
}
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeQrCodeResult::Data RecognizeQrCodeResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeStampRequest.cc
Normal file
51
ocr/src/model/RecognizeStampRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeStampRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeStampRequest;
|
||||
|
||||
RecognizeStampRequest::RecognizeStampRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeStamp")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeStampRequest::~RecognizeStampRequest()
|
||||
{}
|
||||
|
||||
int RecognizeStampRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeStampRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeStampRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeStampRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
80
ocr/src/model/RecognizeStampResult.cc
Normal file
80
ocr/src/model/RecognizeStampResult.cc
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeStampResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeStampResult::RecognizeStampResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeStampResult::RecognizeStampResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeStampResult::~RecognizeStampResult()
|
||||
{}
|
||||
|
||||
void RecognizeStampResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allResultsNode = dataNode["Results"]["ResultsItem"];
|
||||
for (auto dataNodeResultsResultsItem : allResultsNode)
|
||||
{
|
||||
Data::ResultsItem resultsItemObject;
|
||||
auto allGeneralTextNode = allResultsNode["GeneralText"]["GeneralTextItem"];
|
||||
for (auto allResultsNodeGeneralTextGeneralTextItem : allGeneralTextNode)
|
||||
{
|
||||
Data::ResultsItem::GeneralTextItem generalTextObject;
|
||||
if(!allResultsNodeGeneralTextGeneralTextItem["Content"].isNull())
|
||||
generalTextObject.content = allResultsNodeGeneralTextGeneralTextItem["Content"].asString();
|
||||
if(!allResultsNodeGeneralTextGeneralTextItem["Confidence"].isNull())
|
||||
generalTextObject.confidence = std::stof(allResultsNodeGeneralTextGeneralTextItem["Confidence"].asString());
|
||||
resultsItemObject.generalText.push_back(generalTextObject);
|
||||
}
|
||||
auto roiNode = value["Roi"];
|
||||
if(!roiNode["Left"].isNull())
|
||||
resultsItemObject.roi.left = std::stoi(roiNode["Left"].asString());
|
||||
if(!roiNode["Top"].isNull())
|
||||
resultsItemObject.roi.top = std::stoi(roiNode["Top"].asString());
|
||||
if(!roiNode["Width"].isNull())
|
||||
resultsItemObject.roi.width = std::stoi(roiNode["Width"].asString());
|
||||
if(!roiNode["Height"].isNull())
|
||||
resultsItemObject.roi.height = std::stoi(roiNode["Height"].asString());
|
||||
auto textNode = value["Text"];
|
||||
if(!textNode["Content"].isNull())
|
||||
resultsItemObject.text.content = textNode["Content"].asString();
|
||||
if(!textNode["Confidence"].isNull())
|
||||
resultsItemObject.text.confidence = std::stof(textNode["Confidence"].asString());
|
||||
data_.results.push_back(resultsItemObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeStampResult::Data RecognizeStampResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
106
ocr/src/model/RecognizeTableRequest.cc
Normal file
106
ocr/src/model/RecognizeTableRequest.cc
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTableRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeTableRequest;
|
||||
|
||||
RecognizeTableRequest::RecognizeTableRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeTable")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeTableRequest::~RecognizeTableRequest()
|
||||
{}
|
||||
|
||||
int RecognizeTableRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeTableRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
bool RecognizeTableRequest::getUseFinanceModel()const
|
||||
{
|
||||
return useFinanceModel_;
|
||||
}
|
||||
|
||||
void RecognizeTableRequest::setUseFinanceModel(bool useFinanceModel)
|
||||
{
|
||||
useFinanceModel_ = useFinanceModel;
|
||||
setBodyParameter("UseFinanceModel", useFinanceModel ? "true" : "false");
|
||||
}
|
||||
|
||||
bool RecognizeTableRequest::getSkipDetection()const
|
||||
{
|
||||
return skipDetection_;
|
||||
}
|
||||
|
||||
void RecognizeTableRequest::setSkipDetection(bool skipDetection)
|
||||
{
|
||||
skipDetection_ = skipDetection;
|
||||
setBodyParameter("SkipDetection", skipDetection ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string RecognizeTableRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeTableRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
std::string RecognizeTableRequest::getOutputFormat()const
|
||||
{
|
||||
return outputFormat_;
|
||||
}
|
||||
|
||||
void RecognizeTableRequest::setOutputFormat(const std::string& outputFormat)
|
||||
{
|
||||
outputFormat_ = outputFormat;
|
||||
setBodyParameter("OutputFormat", outputFormat);
|
||||
}
|
||||
|
||||
bool RecognizeTableRequest::getAssureDirection()const
|
||||
{
|
||||
return assureDirection_;
|
||||
}
|
||||
|
||||
void RecognizeTableRequest::setAssureDirection(bool assureDirection)
|
||||
{
|
||||
assureDirection_ = assureDirection;
|
||||
setBodyParameter("AssureDirection", assureDirection ? "true" : "false");
|
||||
}
|
||||
|
||||
bool RecognizeTableRequest::getHasLine()const
|
||||
{
|
||||
return hasLine_;
|
||||
}
|
||||
|
||||
void RecognizeTableRequest::setHasLine(bool hasLine)
|
||||
{
|
||||
hasLine_ = hasLine;
|
||||
setBodyParameter("HasLine", hasLine ? "true" : "false");
|
||||
}
|
||||
|
||||
91
ocr/src/model/RecognizeTableResult.cc
Normal file
91
ocr/src/model/RecognizeTableResult.cc
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTableResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeTableResult::RecognizeTableResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeTableResult::RecognizeTableResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeTableResult::~RecognizeTableResult()
|
||||
{}
|
||||
|
||||
void RecognizeTableResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["FileContent"].isNull())
|
||||
data_.fileContent = dataNode["FileContent"].asString();
|
||||
auto allTablesNode = dataNode["Tables"]["Table"];
|
||||
for (auto dataNodeTablesTable : allTablesNode)
|
||||
{
|
||||
Data::Table tableObject;
|
||||
auto allTableRowsNode = allTablesNode["TableRows"]["TableRow"];
|
||||
for (auto allTablesNodeTableRowsTableRow : allTableRowsNode)
|
||||
{
|
||||
Data::Table::TableRow tableRowsObject;
|
||||
auto allTableColumnsNode = allTableRowsNode["TableColumns"]["TableColumn"];
|
||||
for (auto allTableRowsNodeTableColumnsTableColumn : allTableColumnsNode)
|
||||
{
|
||||
Data::Table::TableRow::TableColumn tableColumnsObject;
|
||||
if(!allTableRowsNodeTableColumnsTableColumn["StartColumn"].isNull())
|
||||
tableColumnsObject.startColumn = std::stoi(allTableRowsNodeTableColumnsTableColumn["StartColumn"].asString());
|
||||
if(!allTableRowsNodeTableColumnsTableColumn["StartRow"].isNull())
|
||||
tableColumnsObject.startRow = std::stoi(allTableRowsNodeTableColumnsTableColumn["StartRow"].asString());
|
||||
if(!allTableRowsNodeTableColumnsTableColumn["EndColumn"].isNull())
|
||||
tableColumnsObject.endColumn = std::stoi(allTableRowsNodeTableColumnsTableColumn["EndColumn"].asString());
|
||||
if(!allTableRowsNodeTableColumnsTableColumn["EndRow"].isNull())
|
||||
tableColumnsObject.endRow = std::stoi(allTableRowsNodeTableColumnsTableColumn["EndRow"].asString());
|
||||
if(!allTableRowsNodeTableColumnsTableColumn["Height"].isNull())
|
||||
tableColumnsObject.height = std::stoi(allTableRowsNodeTableColumnsTableColumn["Height"].asString());
|
||||
if(!allTableRowsNodeTableColumnsTableColumn["Width"].isNull())
|
||||
tableColumnsObject.width = std::stoi(allTableRowsNodeTableColumnsTableColumn["Width"].asString());
|
||||
auto allTexts = value["Texts"]["Text"];
|
||||
for (auto value : allTexts)
|
||||
tableColumnsObject.texts.push_back(value.asString());
|
||||
tableRowsObject.tableColumns.push_back(tableColumnsObject);
|
||||
}
|
||||
tableObject.tableRows.push_back(tableRowsObject);
|
||||
}
|
||||
auto allHead = value["Head"]["Head"];
|
||||
for (auto value : allHead)
|
||||
tableObject.head.push_back(value.asString());
|
||||
auto allTail = value["Tail"]["Tail"];
|
||||
for (auto value : allTail)
|
||||
tableObject.tail.push_back(value.asString());
|
||||
data_.tables.push_back(tableObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeTableResult::Data RecognizeTableResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
ocr/src/model/RecognizeTakeoutOrderRequest.cc
Normal file
40
ocr/src/model/RecognizeTakeoutOrderRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTakeoutOrderRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeTakeoutOrderRequest;
|
||||
|
||||
RecognizeTakeoutOrderRequest::RecognizeTakeoutOrderRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeTakeoutOrder")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeTakeoutOrderRequest::~RecognizeTakeoutOrderRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeTakeoutOrderRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeTakeoutOrderRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
65
ocr/src/model/RecognizeTakeoutOrderResult.cc
Normal file
65
ocr/src/model/RecognizeTakeoutOrderResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeTakeoutOrderResult::RecognizeTakeoutOrderResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeTakeoutOrderResult::RecognizeTakeoutOrderResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeTakeoutOrderResult::~RecognizeTakeoutOrderResult()
|
||||
{}
|
||||
|
||||
void RecognizeTakeoutOrderResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
if(!dataNodeElementsElement["Name"].isNull())
|
||||
elementObject.name = dataNodeElementsElement["Name"].asString();
|
||||
if(!dataNodeElementsElement["Value"].isNull())
|
||||
elementObject.value = dataNodeElementsElement["Value"].asString();
|
||||
auto allBoxes = value["Boxes"]["Box"];
|
||||
for (auto value : allBoxes)
|
||||
elementObject.boxes.push_back(value.asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeTakeoutOrderResult::Data RecognizeTakeoutOrderResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeTaxiInvoiceRequest.cc
Normal file
51
ocr/src/model/RecognizeTaxiInvoiceRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeTaxiInvoiceRequest;
|
||||
|
||||
RecognizeTaxiInvoiceRequest::RecognizeTaxiInvoiceRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeTaxiInvoice")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeTaxiInvoiceRequest::~RecognizeTaxiInvoiceRequest()
|
||||
{}
|
||||
|
||||
int RecognizeTaxiInvoiceRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeTaxiInvoiceRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeTaxiInvoiceRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeTaxiInvoiceRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
88
ocr/src/model/RecognizeTaxiInvoiceResult.cc
Normal file
88
ocr/src/model/RecognizeTaxiInvoiceResult.cc
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeTaxiInvoiceResult::RecognizeTaxiInvoiceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeTaxiInvoiceResult::RecognizeTaxiInvoiceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeTaxiInvoiceResult::~RecognizeTaxiInvoiceResult()
|
||||
{}
|
||||
|
||||
void RecognizeTaxiInvoiceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allInvoicesNode = dataNode["Invoices"]["Invoice"];
|
||||
for (auto dataNodeInvoicesInvoice : allInvoicesNode)
|
||||
{
|
||||
Data::Invoice invoiceObject;
|
||||
if(!dataNodeInvoicesInvoice["RotateType"].isNull())
|
||||
invoiceObject.rotateType = std::stoi(dataNodeInvoicesInvoice["RotateType"].asString());
|
||||
auto allItemsNode = allInvoicesNode["Items"]["Item"];
|
||||
for (auto allInvoicesNodeItemsItem : allItemsNode)
|
||||
{
|
||||
Data::Invoice::Item itemsObject;
|
||||
if(!allInvoicesNodeItemsItem["Text"].isNull())
|
||||
itemsObject.text = allInvoicesNodeItemsItem["Text"].asString();
|
||||
auto itemRoiNode = value["ItemRoi"];
|
||||
if(!itemRoiNode["Angle"].isNull())
|
||||
itemsObject.itemRoi.angle = std::stof(itemRoiNode["Angle"].asString());
|
||||
auto centerNode = itemRoiNode["Center"];
|
||||
if(!centerNode["X"].isNull())
|
||||
itemsObject.itemRoi.center.x = std::stof(centerNode["X"].asString());
|
||||
if(!centerNode["Y"].isNull())
|
||||
itemsObject.itemRoi.center.y = std::stof(centerNode["Y"].asString());
|
||||
auto sizeNode = itemRoiNode["Size"];
|
||||
if(!sizeNode["H"].isNull())
|
||||
itemsObject.itemRoi.size.h = std::stof(sizeNode["H"].asString());
|
||||
if(!sizeNode["W"].isNull())
|
||||
itemsObject.itemRoi.size.w = std::stof(sizeNode["W"].asString());
|
||||
invoiceObject.items.push_back(itemsObject);
|
||||
}
|
||||
auto invoiceRoiNode = value["InvoiceRoi"];
|
||||
if(!invoiceRoiNode["H"].isNull())
|
||||
invoiceObject.invoiceRoi.h = std::stof(invoiceRoiNode["H"].asString());
|
||||
if(!invoiceRoiNode["W"].isNull())
|
||||
invoiceObject.invoiceRoi.w = std::stof(invoiceRoiNode["W"].asString());
|
||||
if(!invoiceRoiNode["X"].isNull())
|
||||
invoiceObject.invoiceRoi.x = std::stof(invoiceRoiNode["X"].asString());
|
||||
if(!invoiceRoiNode["Y"].isNull())
|
||||
invoiceObject.invoiceRoi.y = std::stof(invoiceRoiNode["Y"].asString());
|
||||
data_.invoices.push_back(invoiceObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeTaxiInvoiceResult::Data RecognizeTaxiInvoiceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeTrainTicketRequest.cc
Normal file
51
ocr/src/model/RecognizeTrainTicketRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTrainTicketRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeTrainTicketRequest;
|
||||
|
||||
RecognizeTrainTicketRequest::RecognizeTrainTicketRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeTrainTicket")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeTrainTicketRequest::~RecognizeTrainTicketRequest()
|
||||
{}
|
||||
|
||||
int RecognizeTrainTicketRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeTrainTicketRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeTrainTicketRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeTrainTicketRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
66
ocr/src/model/RecognizeTrainTicketResult.cc
Normal file
66
ocr/src/model/RecognizeTrainTicketResult.cc
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTrainTicketResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeTrainTicketResult::RecognizeTrainTicketResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeTrainTicketResult::RecognizeTrainTicketResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeTrainTicketResult::~RecognizeTrainTicketResult()
|
||||
{}
|
||||
|
||||
void RecognizeTrainTicketResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Date"].isNull())
|
||||
data_.date = dataNode["Date"].asString();
|
||||
if(!dataNode["Destination"].isNull())
|
||||
data_.destination = dataNode["Destination"].asString();
|
||||
if(!dataNode["Level"].isNull())
|
||||
data_.level = dataNode["Level"].asString();
|
||||
if(!dataNode["Number"].isNull())
|
||||
data_.number = dataNode["Number"].asString();
|
||||
if(!dataNode["Name"].isNull())
|
||||
data_.name = dataNode["Name"].asString();
|
||||
if(!dataNode["DepartureStation"].isNull())
|
||||
data_.departureStation = dataNode["DepartureStation"].asString();
|
||||
if(!dataNode["Seat"].isNull())
|
||||
data_.seat = dataNode["Seat"].asString();
|
||||
if(!dataNode["Price"].isNull())
|
||||
data_.price = std::stof(dataNode["Price"].asString());
|
||||
|
||||
}
|
||||
|
||||
RecognizeTrainTicketResult::Data RecognizeTrainTicketResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeVATInvoiceRequest.cc
Normal file
51
ocr/src/model/RecognizeVATInvoiceRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeVATInvoiceRequest;
|
||||
|
||||
RecognizeVATInvoiceRequest::RecognizeVATInvoiceRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeVATInvoice")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeVATInvoiceRequest::~RecognizeVATInvoiceRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeVATInvoiceRequest::getFileType()const
|
||||
{
|
||||
return fileType_;
|
||||
}
|
||||
|
||||
void RecognizeVATInvoiceRequest::setFileType(const std::string& fileType)
|
||||
{
|
||||
fileType_ = fileType;
|
||||
setBodyParameter("FileType", fileType);
|
||||
}
|
||||
|
||||
std::string RecognizeVATInvoiceRequest::getFileURL()const
|
||||
{
|
||||
return fileURL_;
|
||||
}
|
||||
|
||||
void RecognizeVATInvoiceRequest::setFileURL(const std::string& fileURL)
|
||||
{
|
||||
fileURL_ = fileURL;
|
||||
setBodyParameter("FileURL", fileURL);
|
||||
}
|
||||
|
||||
147
ocr/src/model/RecognizeVATInvoiceResult.cc
Normal file
147
ocr/src/model/RecognizeVATInvoiceResult.cc
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeVATInvoiceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeVATInvoiceResult::RecognizeVATInvoiceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeVATInvoiceResult::RecognizeVATInvoiceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeVATInvoiceResult::~RecognizeVATInvoiceResult()
|
||||
{}
|
||||
|
||||
void RecognizeVATInvoiceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto contentNode = dataNode["Content"];
|
||||
if(!contentNode["InvoiceCode"].isNull())
|
||||
data_.content.invoiceCode = contentNode["InvoiceCode"].asString();
|
||||
if(!contentNode["InvoiceNo"].isNull())
|
||||
data_.content.invoiceNo = contentNode["InvoiceNo"].asString();
|
||||
if(!contentNode["InvoiceDate"].isNull())
|
||||
data_.content.invoiceDate = contentNode["InvoiceDate"].asString();
|
||||
if(!contentNode["AntiFakeCode"].isNull())
|
||||
data_.content.antiFakeCode = contentNode["AntiFakeCode"].asString();
|
||||
if(!contentNode["PayerName"].isNull())
|
||||
data_.content.payerName = contentNode["PayerName"].asString();
|
||||
if(!contentNode["PayerRegisterNo"].isNull())
|
||||
data_.content.payerRegisterNo = contentNode["PayerRegisterNo"].asString();
|
||||
if(!contentNode["PayerAddress"].isNull())
|
||||
data_.content.payerAddress = contentNode["PayerAddress"].asString();
|
||||
if(!contentNode["PayerBankName"].isNull())
|
||||
data_.content.payerBankName = contentNode["PayerBankName"].asString();
|
||||
if(!contentNode["WithoutTaxAmount"].isNull())
|
||||
data_.content.withoutTaxAmount = contentNode["WithoutTaxAmount"].asString();
|
||||
if(!contentNode["TaxAmount"].isNull())
|
||||
data_.content.taxAmount = contentNode["TaxAmount"].asString();
|
||||
if(!contentNode["SumAmount"].isNull())
|
||||
data_.content.sumAmount = contentNode["SumAmount"].asString();
|
||||
if(!contentNode["InvoiceAmount"].isNull())
|
||||
data_.content.invoiceAmount = contentNode["InvoiceAmount"].asString();
|
||||
if(!contentNode["PayeeName"].isNull())
|
||||
data_.content.payeeName = contentNode["PayeeName"].asString();
|
||||
if(!contentNode["PayeeRegisterNo"].isNull())
|
||||
data_.content.payeeRegisterNo = contentNode["PayeeRegisterNo"].asString();
|
||||
if(!contentNode["PayeeAddress"].isNull())
|
||||
data_.content.payeeAddress = contentNode["PayeeAddress"].asString();
|
||||
if(!contentNode["PayeeBankName"].isNull())
|
||||
data_.content.payeeBankName = contentNode["PayeeBankName"].asString();
|
||||
if(!contentNode["Payee"].isNull())
|
||||
data_.content.payee = contentNode["Payee"].asString();
|
||||
if(!contentNode["Checker"].isNull())
|
||||
data_.content.checker = contentNode["Checker"].asString();
|
||||
if(!contentNode["Clerk"].isNull())
|
||||
data_.content.clerk = contentNode["Clerk"].asString();
|
||||
auto boxNode = dataNode["Box"];
|
||||
auto allInvoiceCodes = boxNode["InvoiceCodes"]["InvoiceCode"];
|
||||
for (auto value : allInvoiceCodes)
|
||||
data_.box.invoiceCodes.push_back(value.asString());
|
||||
auto allInvoiceNoes = boxNode["InvoiceNoes"]["InvoiceNo"];
|
||||
for (auto value : allInvoiceNoes)
|
||||
data_.box.invoiceNoes.push_back(value.asString());
|
||||
auto allInvoiceDates = boxNode["InvoiceDates"]["InvoiceDate"];
|
||||
for (auto value : allInvoiceDates)
|
||||
data_.box.invoiceDates.push_back(value.asString());
|
||||
auto allInvoiceFakeCodes = boxNode["InvoiceFakeCodes"]["InvoiceFakeCode"];
|
||||
for (auto value : allInvoiceFakeCodes)
|
||||
data_.box.invoiceFakeCodes.push_back(value.asString());
|
||||
auto allPayerNames = boxNode["PayerNames"]["PayerName"];
|
||||
for (auto value : allPayerNames)
|
||||
data_.box.payerNames.push_back(value.asString());
|
||||
auto allPayerRegisterNoes = boxNode["PayerRegisterNoes"]["PayerRegisterNo"];
|
||||
for (auto value : allPayerRegisterNoes)
|
||||
data_.box.payerRegisterNoes.push_back(value.asString());
|
||||
auto allPayerAddresses = boxNode["PayerAddresses"]["PayerAddress"];
|
||||
for (auto value : allPayerAddresses)
|
||||
data_.box.payerAddresses.push_back(value.asString());
|
||||
auto allPayerBankNames = boxNode["PayerBankNames"]["PayerBankNames"];
|
||||
for (auto value : allPayerBankNames)
|
||||
data_.box.payerBankNames.push_back(value.asString());
|
||||
auto allWithoutTaxAmounts = boxNode["WithoutTaxAmounts"]["WithoutTaxAmount"];
|
||||
for (auto value : allWithoutTaxAmounts)
|
||||
data_.box.withoutTaxAmounts.push_back(value.asString());
|
||||
auto allTaxAmounts = boxNode["TaxAmounts"]["TaxAmount"];
|
||||
for (auto value : allTaxAmounts)
|
||||
data_.box.taxAmounts.push_back(value.asString());
|
||||
auto allSumAmounts = boxNode["SumAmounts"]["SumAmount"];
|
||||
for (auto value : allSumAmounts)
|
||||
data_.box.sumAmounts.push_back(value.asString());
|
||||
auto allInvoiceAmounts = boxNode["InvoiceAmounts"]["InvoiceAmount"];
|
||||
for (auto value : allInvoiceAmounts)
|
||||
data_.box.invoiceAmounts.push_back(value.asString());
|
||||
auto allPayeeNames = boxNode["PayeeNames"]["PayeeName"];
|
||||
for (auto value : allPayeeNames)
|
||||
data_.box.payeeNames.push_back(value.asString());
|
||||
auto allPayeeRegisterNoes = boxNode["PayeeRegisterNoes"]["PayeeRegisterNo"];
|
||||
for (auto value : allPayeeRegisterNoes)
|
||||
data_.box.payeeRegisterNoes.push_back(value.asString());
|
||||
auto allPayeeAddresses = boxNode["PayeeAddresses"]["PayeeAddress"];
|
||||
for (auto value : allPayeeAddresses)
|
||||
data_.box.payeeAddresses.push_back(value.asString());
|
||||
auto allPayeeBankNames = boxNode["PayeeBankNames"]["PayeeBankName"];
|
||||
for (auto value : allPayeeBankNames)
|
||||
data_.box.payeeBankNames.push_back(value.asString());
|
||||
auto allPayees = boxNode["Payees"]["Payee"];
|
||||
for (auto value : allPayees)
|
||||
data_.box.payees.push_back(value.asString());
|
||||
auto allCheckers = boxNode["Checkers"]["Checker"];
|
||||
for (auto value : allCheckers)
|
||||
data_.box.checkers.push_back(value.asString());
|
||||
auto allClerks = boxNode["Clerks"]["Clerk"];
|
||||
for (auto value : allClerks)
|
||||
data_.box.clerks.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
RecognizeVATInvoiceResult::Data RecognizeVATInvoiceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
ocr/src/model/RecognizeVINCodeRequest.cc
Normal file
51
ocr/src/model/RecognizeVINCodeRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeVINCodeRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeVINCodeRequest;
|
||||
|
||||
RecognizeVINCodeRequest::RecognizeVINCodeRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeVINCode")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeVINCodeRequest::~RecognizeVINCodeRequest()
|
||||
{}
|
||||
|
||||
int RecognizeVINCodeRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeVINCodeRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeVINCodeRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeVINCodeRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
52
ocr/src/model/RecognizeVINCodeResult.cc
Normal file
52
ocr/src/model/RecognizeVINCodeResult.cc
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeVINCodeResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeVINCodeResult::RecognizeVINCodeResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeVINCodeResult::RecognizeVINCodeResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeVINCodeResult::~RecognizeVINCodeResult()
|
||||
{}
|
||||
|
||||
void RecognizeVINCodeResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["VinCode"].isNull())
|
||||
data_.vinCode = dataNode["VinCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
RecognizeVINCodeResult::Data RecognizeVINCodeResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
ocr/src/model/RecognizeVerificationcodeRequest.cc
Normal file
40
ocr/src/model/RecognizeVerificationcodeRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeVerificationcodeRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeVerificationcodeRequest;
|
||||
|
||||
RecognizeVerificationcodeRequest::RecognizeVerificationcodeRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeVerificationcode")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeVerificationcodeRequest::~RecognizeVerificationcodeRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeVerificationcodeRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeVerificationcodeRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
52
ocr/src/model/RecognizeVerificationcodeResult.cc
Normal file
52
ocr/src/model/RecognizeVerificationcodeResult.cc
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeVerificationcodeResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeVerificationcodeResult::RecognizeVerificationcodeResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeVerificationcodeResult::RecognizeVerificationcodeResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeVerificationcodeResult::~RecognizeVerificationcodeResult()
|
||||
{}
|
||||
|
||||
void RecognizeVerificationcodeResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Content"].isNull())
|
||||
data_.content = dataNode["Content"].asString();
|
||||
|
||||
}
|
||||
|
||||
RecognizeVerificationcodeResult::Data RecognizeVerificationcodeResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
73
ocr/src/model/TrimDocumentRequest.cc
Normal file
73
ocr/src/model/TrimDocumentRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/TrimDocumentRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::TrimDocumentRequest;
|
||||
|
||||
TrimDocumentRequest::TrimDocumentRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "TrimDocument")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
TrimDocumentRequest::~TrimDocumentRequest()
|
||||
{}
|
||||
|
||||
std::string TrimDocumentRequest::getFileType()const
|
||||
{
|
||||
return fileType_;
|
||||
}
|
||||
|
||||
void TrimDocumentRequest::setFileType(const std::string& fileType)
|
||||
{
|
||||
fileType_ = fileType;
|
||||
setBodyParameter("FileType", fileType);
|
||||
}
|
||||
|
||||
bool TrimDocumentRequest::getAsync()const
|
||||
{
|
||||
return async_;
|
||||
}
|
||||
|
||||
void TrimDocumentRequest::setAsync(bool async)
|
||||
{
|
||||
async_ = async;
|
||||
setBodyParameter("Async", async ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string TrimDocumentRequest::getFileURL()const
|
||||
{
|
||||
return fileURL_;
|
||||
}
|
||||
|
||||
void TrimDocumentRequest::setFileURL(const std::string& fileURL)
|
||||
{
|
||||
fileURL_ = fileURL;
|
||||
setBodyParameter("FileURL", fileURL);
|
||||
}
|
||||
|
||||
std::string TrimDocumentRequest::getOutputType()const
|
||||
{
|
||||
return outputType_;
|
||||
}
|
||||
|
||||
void TrimDocumentRequest::setOutputType(const std::string& outputType)
|
||||
{
|
||||
outputType_ = outputType;
|
||||
setBodyParameter("OutputType", outputType);
|
||||
}
|
||||
|
||||
52
ocr/src/model/TrimDocumentResult.cc
Normal file
52
ocr/src/model/TrimDocumentResult.cc
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/TrimDocumentResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
TrimDocumentResult::TrimDocumentResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
TrimDocumentResult::TrimDocumentResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
TrimDocumentResult::~TrimDocumentResult()
|
||||
{}
|
||||
|
||||
void TrimDocumentResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Content"].isNull())
|
||||
data_.content = dataNode["Content"].asString();
|
||||
|
||||
}
|
||||
|
||||
TrimDocumentResult::Data TrimDocumentResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user