这个C++代码是什么意思? 'const ResTable& res = am->getResources();'

What does this C++ code mean? 'const ResTable& res = am->getResources();'

我试图了解如何在 android 中读取 R 文件,在我看到这一行之前一切顺利:

const ResTable& res = am->getResources();

我在文件

中找到了这一行

core/jni/android/android_util_AssetManager.cpp

在方法中

static jobject android_content_AssetManager_getAssignedPackageIdentifiers(JNIEnv* env, jobject clazz)

以前学过一些c&cpp,但是没见过这样的语法,请问这是什么意思?我发现 ResTable 是一个 class,但我在任何地方都找不到符号 'res'。我正在阅读的这个文件是损坏的还是我遗漏了什么?

感谢您的帮助!

它为am指向的AssetManager实例调用getResources方法并将结果保存在res中。 res的类型是const ResTable&,即reference to a const ResTable (which also is the return type of AssetManager::getResources).