The open source OpenXR runtime
at prediction-2 29 lines 913 B view raw
1// Copyright 2020-2021, Collabora, Ltd. 2// SPDX-License-Identifier: BSL-1.0 3// Author: Rylie Pavlik <rylie.pavlik@collabora.com> 4// Inline implementations: do not include on its own! 5 6#pragma once 7 8#include "java.lang.h" 9#include <string> 10 11namespace wrap { 12namespace dalvik::system { 13inline DexClassLoader 14DexClassLoader::construct(std::string const &searchPath, 15 std::string const &nativeSearchPath, 16 jni::Object parentClassLoader) { 17 return DexClassLoader{ 18 Meta::data().clazz().newInstance(Meta::data().init, searchPath, "", 19 nativeSearchPath, parentClassLoader)}; 20} 21 22inline java::lang::Class 23DexClassLoader::loadClass(const std::string &name) { 24 assert(!isNull()); 25 return java::lang::Class{object().call<jni::Object>(Meta::data().loadClass, name)}; 26} 27 28} // namespace dalvik::system 29} // namespace wrap