use of org.robolectric.res.android.CppAssetManager2.ResourceName in project robolectric by robolectric.
the class ShadowArscAssetManager9 method nativeGetResourceEntryName.
// static jstring NativeGetResourceEntryName(JNIEnv* env, jclass /*clazz*/, jlong ptr, jint resid)
// {
@Implementation(minSdk = P)
@Nullable
protected static String nativeGetResourceEntryName(long ptr, @AnyRes int resid) {
CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
final ResourceName name = new ResourceName();
if (!assetmanager.GetResourceName(resid, name)) {
return null;
}
if (name.entry != null) {
return name.entry;
// } else if (name.entry16 != null) {
// return name.entry16; // env.NewString(reinterpret_cast<jchar*>(name.entry16),
// name.entry_len);
}
return null;
}
use of org.robolectric.res.android.CppAssetManager2.ResourceName in project robolectric by robolectric.
the class ShadowArscAssetManager9 method nativeGetResourceName.
// static jstring NativeGetResourceName(JNIEnv* env, jclass /*clazz*/, jlong ptr, jint resid) {
@Implementation(minSdk = P)
@Nullable
protected static String nativeGetResourceName(long ptr, @AnyRes int resid) {
CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
CppAssetManager2.ResourceName name = new ResourceName();
if (!assetmanager.GetResourceName(resid, name)) {
return null;
}
StringBuilder result = new StringBuilder();
if (name.package_ != null) {
result.append(name.package_);
}
if (name.type != null) /*|| name.type16 != null*/
{
if (!(result.length() == 0)) {
result.append(":");
}
// if (name.type != null) {
result.append(name.type);
// } else {
// result.append( /*util.Utf16ToUtf8(StringPiece16(*/ name.type16 /*, name.type_len))*/);
// }
}
if (name.entry != null) /*|| name.entry16 != null*/
{
if (!(result.length() == 0)) {
result.append("/");
}
// if (name.entry != null) {
result.append(name.entry);
// } else {
// result.append( /*util.Utf16ToUtf8(StringPiece16(*/ name.entry16 /*, name.entry_len)*/);
// }
}
return result.toString();
}
use of org.robolectric.res.android.CppAssetManager2.ResourceName in project robolectric by robolectric.
the class ShadowArscAssetManager10 method nativeGetResourceTypeName.
// static jstring NativeGetResourceTypeName(JNIEnv* env, jclass /*clazz*/, jlong ptr, jint resid)
// {
@Implementation(minSdk = P)
@Nullable
protected static String nativeGetResourceTypeName(long ptr, @AnyRes int resid) {
CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
final ResourceName name = new ResourceName();
if (!assetmanager.GetResourceName(resid, name)) {
return null;
}
if (name.type != null) {
return name.type;
// } else if (name.get().type16 != null) {
// return name.get().type16; // env.NewString(reinterpret_cast<jchar*>(name.type16),
// name.type_len);
}
return null;
}
use of org.robolectric.res.android.CppAssetManager2.ResourceName in project robolectric by robolectric.
the class ShadowArscAssetManager10 method nativeGetResourceName.
// static jstring NativeGetResourceName(JNIEnv* env, jclass /*clazz*/, jlong ptr, jint resid) {
@Implementation(minSdk = P)
@Nullable
protected static String nativeGetResourceName(long ptr, @AnyRes int resid) {
CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
CppAssetManager2.ResourceName name = new ResourceName();
if (!assetmanager.GetResourceName(resid, name)) {
return null;
}
StringBuilder result = new StringBuilder();
if (name.package_ != null) {
result.append(name.package_);
}
if (name.type != null) /*|| name.type16 != null*/
{
if (!(result.length() == 0)) {
result.append(":");
}
// if (name.type != null) {
result.append(name.type);
// } else {
// result.append( /*util.Utf16ToUtf8(StringPiece16(*/ name.type16 /*, name.type_len))*/);
// }
}
if (name.entry != null) /*|| name.entry16 != null*/
{
if (!(result.length() == 0)) {
result.append("/");
}
// if (name.entry != null) {
result.append(name.entry);
// } else {
// result.append( /*util.Utf16ToUtf8(StringPiece16(*/ name.entry16 /*, name.entry_len)*/);
// }
}
return result.toString();
}
use of org.robolectric.res.android.CppAssetManager2.ResourceName in project robolectric by robolectric.
the class ShadowArscAssetManager10 method nativeGetResourceEntryName.
// static jstring NativeGetResourceEntryName(JNIEnv* env, jclass /*clazz*/, jlong ptr, jint resid)
// {
@Implementation(minSdk = P)
@Nullable
protected static String nativeGetResourceEntryName(long ptr, @AnyRes int resid) {
CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
final ResourceName name = new ResourceName();
if (!assetmanager.GetResourceName(resid, name)) {
return null;
}
if (name.entry != null) {
return name.entry;
// } else if (name.entry16 != null) {
// return name.entry16; // env.NewString(reinterpret_cast<jchar*>(name.entry16),
// name.entry_len);
}
return null;
}
Aggregations