Reflection are known from Java. Reflection allows the access to data with symbolic (textual) pathes to data. The Reflection principle is also applicable to C or C++ programs. The reflection infos itself are tables connecting the textual names of elements of struct with there offset in the struct and a type and modifier information. If the memory address (pointer) of a base struct is known and all other instances are pointered from this base struct, only this base struct should be known to access to all data in the symbolic way.
If inherition is used (C++) and a reference from base type to a derivated type is used, and the derivated type should be accessed, the information about the Reflection of the derivated instance should be stored in the instance itself. The base-struct ObjectJc or baseclass ObjectJcpp should to be used, it contains the pointer to the Reflection struct.
This example shows only the principle of conversion. The necessary functionality to work with the reflections is containing in CRuntimeJavalike. This so named C(++)-headers and routines are useable in pure C- or C++-programmings, but there are also particularly a part of the Java2C-project, see http://sourceforge.net/projects/java2c.
NOTE: There is a yet known bug: If the argument
-i: contains a
wildcard, at least 1 slash should be placed before. Therefore
is written in the example. It is a bug in org.vishia.util.FileSystem.