This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-Qt/example/doric/loader/DoricJSLoaderManager.cpp
2021-07-21 19:03:29 +08:00

30 lines
769 B
C++

#include "DoricJSLoaderManager.h"
DoricJSLoaderManager::DoricJSLoaderManager() {
qDebug() << "DoricJSLoaderManager constructor";
}
void DoricJSLoaderManager::addJSLoader(DoricInterfaceLoader *jsLoader) {
jsLoaders.insert(jsLoader);
}
QSet<DoricInterfaceLoader *> *DoricJSLoaderManager::getJSLoaders() {
return &jsLoaders;
}
std::shared_ptr<DoricAsyncResult>
DoricJSLoaderManager::request(QString source) {
if (!source.isEmpty()) {
if (source.startsWith("_internal_://")) {
}
foreach (DoricInterfaceLoader *jsLoader, jsLoaders) {
if (jsLoader->filter(source)) {
return jsLoader->request(source);
}
}
}
std::shared_ptr<DoricAsyncResult> asyncResult =
std::make_shared<DoricAsyncResult>();
return asyncResult;
}