mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
825 lines
30 KiB
C++
825 lines
30 KiB
C++
// clang-format off
|
|
|
|
/* ----------------------------------------------------------------------------
|
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
|
* Version 4.1.0
|
|
*
|
|
* This file is not intended to be easily readable and contains a number of
|
|
* coding conventions designed to improve portability and efficiency. Do not make
|
|
* changes to this file unless you know what you are doing--modify the SWIG
|
|
* interface file instead.
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
/****************************************************************************
|
|
Copyright (c) 2022 Xiamen Yaji Software Co., Ltd.
|
|
|
|
http://www.cocos.com
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated engine source code (the "Software"), a limited,
|
|
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
|
|
to use Cocos Creator solely to develop games on your target platforms. You shall
|
|
not use Cocos Creator software for developing other software or tools that's
|
|
used for developing games. You are not granted to publish, distribute,
|
|
sublicense, and/or sell copies of Cocos Creator.
|
|
|
|
The software or tools in this License Agreement are licensed, not sold.
|
|
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
****************************************************************************/
|
|
|
|
#if defined(__clang__)
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic ignored "-Wunused-variable"
|
|
#elif defined(__GNUC__) || defined(__GNUG__)
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
|
#elif defined(_MSC_VER)
|
|
#pragma warning(push)
|
|
#pragma warning(disable : 4101)
|
|
#endif
|
|
|
|
/* internal SWIG method */
|
|
#ifndef SWIGINTERN
|
|
# define SWIGINTERN static
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#include "bindings/jswrapper/SeApi.h"
|
|
#include "bindings/manual/jsb_conversions.h"
|
|
#include "bindings/manual/jsb_global.h"
|
|
|
|
|
|
#include "bindings/auto/jsb_network_auto.h"
|
|
|
|
|
|
#define cc_network_Downloader_onProgress_set(self_, val_) self_->setOnProgress(val_)
|
|
|
|
|
|
|
|
se::Class* __jsb_cc_network_DownloadTask_class = nullptr;
|
|
se::Object* __jsb_cc_network_DownloadTask_proto = nullptr;
|
|
SE_DECLARE_FINALIZE_FUNC(js_delete_cc_network_DownloadTask)
|
|
|
|
static bool js_cc_network_DownloadTask_identifier_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->identifier, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_identifier_set,2,SWIGTYPE_ccstd__string");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_DownloadTask_identifier_set)
|
|
|
|
static bool js_cc_network_DownloadTask_identifier_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->identifier, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_identifier_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->identifier, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_DownloadTask_identifier_get)
|
|
|
|
static bool js_cc_network_DownloadTask_requestURL_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->requestURL, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_requestURL_set,2,SWIGTYPE_ccstd__string");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_DownloadTask_requestURL_set)
|
|
|
|
static bool js_cc_network_DownloadTask_requestURL_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->requestURL, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_requestURL_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->requestURL, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_DownloadTask_requestURL_get)
|
|
|
|
static bool js_cc_network_DownloadTask_storagePath_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->storagePath, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_storagePath_set,2,SWIGTYPE_ccstd__string");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_DownloadTask_storagePath_set)
|
|
|
|
static bool js_cc_network_DownloadTask_storagePath_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->storagePath, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_storagePath_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->storagePath, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_DownloadTask_storagePath_get)
|
|
|
|
static bool js_cc_network_DownloadTask_header_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->header, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_header_set,2,SWIGTYPE_ccstd__unordered_mapT_ccstd__string_ccstd__string_t");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_DownloadTask_header_set)
|
|
|
|
static bool js_cc_network_DownloadTask_header_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloadTask *arg1 = (cc::network::DownloadTask *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloadTask>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->header, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "DownloadTask_header_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->header, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_DownloadTask_header_get)
|
|
|
|
// js_ctor
|
|
static bool js_new_cc_network_DownloadTask(se::State& s) // NOLINT(readability-identifier-naming)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
|
|
cc::network::DownloadTask *result;
|
|
result = (cc::network::DownloadTask *)new cc::network::DownloadTask();
|
|
|
|
|
|
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
|
|
s.thisObject()->setPrivateObject(ptr);
|
|
return true;
|
|
}
|
|
SE_BIND_CTOR(js_new_cc_network_DownloadTask, __jsb_cc_network_DownloadTask_class, js_delete_cc_network_DownloadTask)
|
|
|
|
static bool js_delete_cc_network_DownloadTask(se::State& s)
|
|
{
|
|
// js_dtoroverride
|
|
return true;
|
|
}
|
|
SE_BIND_FINALIZE_FUNC(js_delete_cc_network_DownloadTask)
|
|
|
|
bool js_register_cc_network_DownloadTask(se::Object* obj) {
|
|
auto* cls = se::Class::create("DownloadTask", obj, nullptr, _SE(js_new_cc_network_DownloadTask));
|
|
|
|
cls->defineProperty("identifier", _SE(js_cc_network_DownloadTask_identifier_get), _SE(js_cc_network_DownloadTask_identifier_set));
|
|
cls->defineProperty("requestURL", _SE(js_cc_network_DownloadTask_requestURL_get), _SE(js_cc_network_DownloadTask_requestURL_set));
|
|
cls->defineProperty("storagePath", _SE(js_cc_network_DownloadTask_storagePath_get), _SE(js_cc_network_DownloadTask_storagePath_set));
|
|
cls->defineProperty("header", _SE(js_cc_network_DownloadTask_header_get), _SE(js_cc_network_DownloadTask_header_set));
|
|
|
|
|
|
cls->defineStaticProperty("ERROR_NO_ERROR", nullptr, nullptr);
|
|
cls->defineStaticProperty("ERROR_INVALID_PARAMS", nullptr, nullptr);
|
|
cls->defineStaticProperty("ERROR_FILE_OP_FAILED", nullptr, nullptr);
|
|
cls->defineStaticProperty("ERROR_IMPL_INTERNAL", nullptr, nullptr);
|
|
cls->defineStaticProperty("ERROR_ABORT", nullptr, nullptr);
|
|
|
|
|
|
|
|
cls->defineFinalizeFunction(_SE(js_delete_cc_network_DownloadTask));
|
|
|
|
|
|
cls->install();
|
|
JSBClassType::registerClass<cc::network::DownloadTask>(cls);
|
|
|
|
__jsb_cc_network_DownloadTask_proto = cls->getProto();
|
|
__jsb_cc_network_DownloadTask_class = cls;
|
|
se::ScriptEngine::getInstance()->clearException();
|
|
return true;
|
|
}
|
|
|
|
|
|
se::Class* __jsb_cc_network_DownloaderHints_class = nullptr;
|
|
se::Object* __jsb_cc_network_DownloaderHints_proto = nullptr;
|
|
SE_DECLARE_FINALIZE_FUNC(js_delete_cc_network_DownloaderHints)
|
|
|
|
static bool js_cc_network_DownloaderHints_countOfMaxProcessingTasks_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::DownloaderHints *arg1 = (cc::network::DownloaderHints *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloaderHints>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->countOfMaxProcessingTasks, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "DownloaderHints_countOfMaxProcessingTasks_set,2,SWIGTYPE_uint32_t");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_DownloaderHints_countOfMaxProcessingTasks_set)
|
|
|
|
static bool js_cc_network_DownloaderHints_countOfMaxProcessingTasks_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloaderHints *arg1 = (cc::network::DownloaderHints *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloaderHints>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->countOfMaxProcessingTasks, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "DownloaderHints_countOfMaxProcessingTasks_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->countOfMaxProcessingTasks, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_DownloaderHints_countOfMaxProcessingTasks_get)
|
|
|
|
static bool js_cc_network_DownloaderHints_timeoutInSeconds_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::DownloaderHints *arg1 = (cc::network::DownloaderHints *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloaderHints>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->timeoutInSeconds, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "DownloaderHints_timeoutInSeconds_set,2,SWIGTYPE_uint32_t");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_DownloaderHints_timeoutInSeconds_set)
|
|
|
|
static bool js_cc_network_DownloaderHints_timeoutInSeconds_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloaderHints *arg1 = (cc::network::DownloaderHints *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloaderHints>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->timeoutInSeconds, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "DownloaderHints_timeoutInSeconds_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->timeoutInSeconds, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_DownloaderHints_timeoutInSeconds_get)
|
|
|
|
static bool js_cc_network_DownloaderHints_tempFileNameSuffix_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::DownloaderHints *arg1 = (cc::network::DownloaderHints *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloaderHints>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->tempFileNameSuffix, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "DownloaderHints_tempFileNameSuffix_set,2,SWIGTYPE_ccstd__string");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_DownloaderHints_tempFileNameSuffix_set)
|
|
|
|
static bool js_cc_network_DownloaderHints_tempFileNameSuffix_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloaderHints *arg1 = (cc::network::DownloaderHints *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::DownloaderHints>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->tempFileNameSuffix, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "DownloaderHints_tempFileNameSuffix_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->tempFileNameSuffix, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_DownloaderHints_tempFileNameSuffix_get)
|
|
|
|
// js_ctor
|
|
static bool js_new_cc_network_DownloaderHints(se::State& s) // NOLINT(readability-identifier-naming)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
|
|
cc::network::DownloaderHints *result;
|
|
result = (cc::network::DownloaderHints *)new cc::network::DownloaderHints();
|
|
|
|
|
|
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
|
|
s.thisObject()->setPrivateObject(ptr);
|
|
return true;
|
|
}
|
|
SE_BIND_CTOR(js_new_cc_network_DownloaderHints, __jsb_cc_network_DownloaderHints_class, js_delete_cc_network_DownloaderHints)
|
|
|
|
static bool js_delete_cc_network_DownloaderHints(se::State& s)
|
|
{
|
|
// js_dtoroverride
|
|
return true;
|
|
}
|
|
SE_BIND_FINALIZE_FUNC(js_delete_cc_network_DownloaderHints)
|
|
|
|
template<>
|
|
bool sevalue_to_native(const se::Value &from, cc::network::DownloaderHints * to, se::Object *ctx)
|
|
{
|
|
assert(from.isObject());
|
|
se::Object *json = from.toObject();
|
|
auto* data = reinterpret_cast<cc::network::DownloaderHints*>(json->getPrivateData());
|
|
if (data) {
|
|
*to = *data;
|
|
return true;
|
|
}
|
|
se::Value field;
|
|
bool ok = true;
|
|
|
|
json->getProperty("countOfMaxProcessingTasks", &field, true);
|
|
if (!field.isNullOrUndefined()) {
|
|
ok &= sevalue_to_native(field, &(to->countOfMaxProcessingTasks), ctx);
|
|
}
|
|
|
|
|
|
json->getProperty("timeoutInSeconds", &field, true);
|
|
if (!field.isNullOrUndefined()) {
|
|
ok &= sevalue_to_native(field, &(to->timeoutInSeconds), ctx);
|
|
}
|
|
|
|
|
|
json->getProperty("tempFileNameSuffix", &field, true);
|
|
if (!field.isNullOrUndefined()) {
|
|
ok &= sevalue_to_native(field, &(to->tempFileNameSuffix), ctx);
|
|
}
|
|
|
|
|
|
return ok;
|
|
}
|
|
|
|
|
|
bool js_register_cc_network_DownloaderHints(se::Object* obj) {
|
|
auto* cls = se::Class::create("DownloaderHints", obj, nullptr, _SE(js_new_cc_network_DownloaderHints));
|
|
|
|
cls->defineProperty("countOfMaxProcessingTasks", _SE(js_cc_network_DownloaderHints_countOfMaxProcessingTasks_get), _SE(js_cc_network_DownloaderHints_countOfMaxProcessingTasks_set));
|
|
cls->defineProperty("timeoutInSeconds", _SE(js_cc_network_DownloaderHints_timeoutInSeconds_get), _SE(js_cc_network_DownloaderHints_timeoutInSeconds_set));
|
|
cls->defineProperty("tempFileNameSuffix", _SE(js_cc_network_DownloaderHints_tempFileNameSuffix_get), _SE(js_cc_network_DownloaderHints_tempFileNameSuffix_set));
|
|
|
|
|
|
|
|
|
|
|
|
cls->defineFinalizeFunction(_SE(js_delete_cc_network_DownloaderHints));
|
|
|
|
|
|
cls->install();
|
|
JSBClassType::registerClass<cc::network::DownloaderHints>(cls);
|
|
|
|
__jsb_cc_network_DownloaderHints_proto = cls->getProto();
|
|
__jsb_cc_network_DownloaderHints_class = cls;
|
|
se::ScriptEngine::getInstance()->clearException();
|
|
return true;
|
|
}
|
|
|
|
|
|
se::Class* __jsb_cc_network_Downloader_class = nullptr;
|
|
se::Object* __jsb_cc_network_Downloader_proto = nullptr;
|
|
SE_DECLARE_FINALIZE_FUNC(js_delete_cc_network_Downloader)
|
|
|
|
static bool js_new_cc_network_Downloader__SWIG_0(se::State& s) // NOLINT(readability-identifier-naming)
|
|
{
|
|
// js_overloaded_ctor
|
|
const auto& args = s.args();
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::Downloader *result;
|
|
result = (cc::network::Downloader *)new cc::network::Downloader();
|
|
|
|
|
|
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
|
|
s.thisObject()->setPrivateObject(ptr);
|
|
return true;
|
|
}
|
|
|
|
|
|
static bool js_new_cc_network_Downloader__SWIG_1(se::State& s) // NOLINT(readability-identifier-naming)
|
|
{
|
|
// js_overloaded_ctor
|
|
const auto& args = s.args();
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::DownloaderHints *arg1 = 0 ;
|
|
cc::network::DownloaderHints temp1 ;
|
|
cc::network::Downloader *result;
|
|
// %typemap(in) SWIGTYPE&
|
|
ok &= sevalue_to_native(args[0], &temp1, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "new_Downloader,1,SWIGTYPE_p_cc__network__DownloaderHints");
|
|
arg1 = &temp1;
|
|
|
|
result = (cc::network::Downloader *)new cc::network::Downloader((cc::network::DownloaderHints const &)*arg1);
|
|
|
|
|
|
auto *ptr = JSB_MAKE_PRIVATE_OBJECT_WITH_INSTANCE(result);
|
|
s.thisObject()->setPrivateObject(ptr);
|
|
return true;
|
|
}
|
|
|
|
|
|
static bool js_new_Downloader(se::State& s) // NOLINT(readability-identifier-naming)
|
|
{
|
|
// js_ctor_dispatcher
|
|
size_t argc = s.args().size();
|
|
bool ret = false;
|
|
|
|
// switch all cases by means of series of if-returns.
|
|
|
|
// js_ctor_dispatch_case
|
|
if(argc == 0) {
|
|
ret = js_new_cc_network_Downloader__SWIG_0(s);
|
|
if (ret) {
|
|
return ret;
|
|
} /* reset exception and return */
|
|
}
|
|
|
|
// js_ctor_dispatch_case
|
|
if(argc == 1) {
|
|
ret = js_new_cc_network_Downloader__SWIG_1(s);
|
|
if (ret) {
|
|
return ret;
|
|
} /* reset exception and return */
|
|
}
|
|
|
|
|
|
// default:
|
|
SE_REPORT_ERROR("Illegal arguments for construction of Downloader");
|
|
return false;
|
|
}
|
|
SE_BIND_CTOR(js_new_Downloader, __jsb_cc_network_Downloader_class, js_delete_cc_network_Downloader)
|
|
|
|
static bool js_delete_cc_network_Downloader(se::State& s)
|
|
{
|
|
// js_dtoroverride
|
|
return true;
|
|
}
|
|
SE_BIND_FINALIZE_FUNC(js_delete_cc_network_Downloader)
|
|
|
|
static bool js_cc_network_Downloader_onDataTaskSuccess_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->onDataTaskSuccess, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "Downloader_onDataTaskSuccess_set,2,SWIGTYPE_std__functionT_void_fcc__network__DownloadTask_const_R_ccstd__vectorT_unsigned_char_t_const_RF_t");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_Downloader_onDataTaskSuccess_set)
|
|
|
|
static bool js_cc_network_Downloader_onDataTaskSuccess_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->onDataTaskSuccess, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "Downloader_onDataTaskSuccess_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->onDataTaskSuccess, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_Downloader_onDataTaskSuccess_get)
|
|
|
|
static bool js_cc_network_Downloader_onFileTaskSuccess_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->onFileTaskSuccess, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "Downloader_onFileTaskSuccess_set,2,SWIGTYPE_std__functionT_void_fcc__network__DownloadTask_const_RF_t");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_Downloader_onFileTaskSuccess_set)
|
|
|
|
static bool js_cc_network_Downloader_onFileTaskSuccess_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->onFileTaskSuccess, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "Downloader_onFileTaskSuccess_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->onFileTaskSuccess, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_Downloader_onFileTaskSuccess_get)
|
|
|
|
static bool js_cc_network_Downloader_onTaskProgress_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->onTaskProgress, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "Downloader_onTaskProgress_set,2,SWIGTYPE_std__functionT_void_fcc__network__DownloadTask_const_R_uint32_t_uint32_t_uint32_tF_t");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_Downloader_onTaskProgress_set)
|
|
|
|
static bool js_cc_network_Downloader_onTaskProgress_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->onTaskProgress, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "Downloader_onTaskProgress_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->onTaskProgress, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_Downloader_onTaskProgress_get)
|
|
|
|
static bool js_cc_network_Downloader_onTaskError_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
|
|
// %typemap(in) SWIGTYPE value in
|
|
ok &= sevalue_to_native(args[0], &arg1->onTaskError, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "Downloader_onTaskError_set,2,SWIGTYPE_std__functionT_void_fcc__network__DownloadTask_const_R_int_int_ccstd__string_const_RF_t");
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_Downloader_onTaskError_set)
|
|
|
|
static bool js_cc_network_Downloader_onTaskError_get(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(out) SWIGTYPE
|
|
ok &= nativevalue_to_se(arg1->onTaskError, s.rval(), s.thisObject() /*ctx*/);
|
|
SE_PRECONDITION2(ok, false, "Downloader_onTaskError_get, Error processing arguments");
|
|
SE_HOLD_RETURN_VALUE(arg1->onTaskError, s.thisObject(), s.rval());
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_GET(js_cc_network_Downloader_onTaskError_get)
|
|
|
|
static bool js_cc_network_Downloader_setOnTaskProgress(se::State& s)
|
|
{
|
|
// js_function
|
|
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
std::function< void (cc::network::DownloadTask const &,uint32_t,uint32_t,uint32_t) > *arg2 = 0 ;
|
|
std::function< void (cc::network::DownloadTask const &,uint32_t,uint32_t,uint32_t) > temp2 ;
|
|
|
|
if(argc != 1) {
|
|
SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1);
|
|
return false;
|
|
}
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(in) SWIGTYPE&
|
|
ok &= sevalue_to_native(args[0], &temp2, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "Downloader_setOnTaskProgress,2,SWIGTYPE_p_std__functionT_void_fcc__network__DownloadTask_const_R_uint32_t_uint32_t_uint32_tF_t");
|
|
arg2 = &temp2;
|
|
|
|
(arg1)->setOnTaskProgress((std::function< void (cc::network::DownloadTask const &,uint32_t,uint32_t,uint32_t) > const &)*arg2);
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_FUNC(js_cc_network_Downloader_setOnTaskProgress)
|
|
|
|
static bool js_cc_network_Downloader_onProgress_set(se::State& s)
|
|
{
|
|
CC_UNUSED bool ok = true;
|
|
const auto& args = s.args();
|
|
size_t argc = args.size();
|
|
cc::network::Downloader *arg1 = (cc::network::Downloader *) NULL ;
|
|
std::function< void (cc::network::DownloadTask const &,uint32_t,uint32_t,uint32_t) > *arg2 = 0 ;
|
|
std::function< void (cc::network::DownloadTask const &,uint32_t,uint32_t,uint32_t) > temp2 ;
|
|
|
|
arg1 = SE_THIS_OBJECT<cc::network::Downloader>(s);
|
|
SE_PRECONDITION2(arg1, false, "%s: Invalid Native Object", __FUNCTION__);
|
|
// %typemap(in) SWIGTYPE&
|
|
ok &= sevalue_to_native(args[0], &temp2, s.thisObject());
|
|
SE_PRECONDITION2(ok, false, "Downloader_onProgress_set,2,SWIGTYPE_p_std__functionT_void_fcc__network__DownloadTask_const_R_uint32_t_uint32_t_uint32_tF_t");
|
|
arg2 = &temp2;
|
|
|
|
cc_network_Downloader_onProgress_set(arg1,*arg2);
|
|
|
|
|
|
return true;
|
|
}
|
|
SE_BIND_PROP_SET(js_cc_network_Downloader_onProgress_set)
|
|
|
|
bool js_register_cc_network_Downloader(se::Object* obj) {
|
|
auto* cls = se::Class::create("Downloader", obj, nullptr, _SE(js_new_Downloader));
|
|
|
|
cls->defineProperty("onDataTaskSuccess", _SE(js_cc_network_Downloader_onDataTaskSuccess_get), _SE(js_cc_network_Downloader_onDataTaskSuccess_set));
|
|
cls->defineProperty("onFileTaskSuccess", _SE(js_cc_network_Downloader_onFileTaskSuccess_get), _SE(js_cc_network_Downloader_onFileTaskSuccess_set));
|
|
cls->defineProperty("onTaskProgress", _SE(js_cc_network_Downloader_onTaskProgress_get), _SE(js_cc_network_Downloader_onTaskProgress_set));
|
|
cls->defineProperty("onTaskError", _SE(js_cc_network_Downloader_onTaskError_get), _SE(js_cc_network_Downloader_onTaskError_set));
|
|
cls->defineProperty("onProgress", nullptr, _SE(js_cc_network_Downloader_onProgress_set));
|
|
|
|
cls->defineFunction("setOnTaskProgress", _SE(js_cc_network_Downloader_setOnTaskProgress));
|
|
|
|
|
|
|
|
|
|
cls->defineFinalizeFunction(_SE(js_delete_cc_network_Downloader));
|
|
|
|
|
|
cls->install();
|
|
JSBClassType::registerClass<cc::network::Downloader>(cls);
|
|
|
|
__jsb_cc_network_Downloader_proto = cls->getProto();
|
|
__jsb_cc_network_Downloader_class = cls;
|
|
se::ScriptEngine::getInstance()->clearException();
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
bool register_all_network(se::Object* obj) {
|
|
// Get the ns
|
|
se::Value nsVal;
|
|
if (!obj->getProperty("jsb", &nsVal, true))
|
|
{
|
|
se::HandleObject jsobj(se::Object::createPlainObject());
|
|
nsVal.setObject(jsobj);
|
|
obj->setProperty("jsb", nsVal);
|
|
}
|
|
se::Object* ns = nsVal.toObject();
|
|
/* Register classes */
|
|
js_register_cc_network_DownloadTask(ns);
|
|
js_register_cc_network_DownloaderHints(ns);
|
|
js_register_cc_network_Downloader(ns);
|
|
|
|
/* Register global variables & global functions */
|
|
|
|
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
#if defined(__clang__)
|
|
#pragma clang diagnostic pop
|
|
#elif defined(__GNUC__) || defined(__GNUG__)
|
|
#pragma GCC diagnostic pop
|
|
#elif defined(_MSC_VER)
|
|
#pragma warning(pop)
|
|
#endif
|
|
// clang-format on
|