Data descriptions are separated into three different categories:
The information of a data description is stored as a maxon::DataDictionary. The settings stored in these dictionaries is accessed with pre-defined resource IDs (see Resource IDs ).
// This example loads the description of the given data type and prints the attributes to the console.// data type ID const maxon::Id dataType { "net.maxonexample.class.descriptionElement" };
// load description data maxon::Id category = maxon::DATADESCRIPTION_CATEGORY_DATA ; const maxon::DataDescription descriptionData = maxon::DataDescriptionDatabaseInterface::LoadDescription (category, maxon::LanguageRef(), dataType) iferr_return ;
// load description string data category = maxon::DATADESCRIPTION_CATEGORY_STRING ; const maxon::LanguageRef language = maxon::Resource::GetDefaultLanguage (); const maxon::DataDescription descriptionStrings = maxon::DataDescriptionDatabaseInterface::LoadDescription (category, language, dataType) iferr_return ;
// list all attributes
// get localized attribute name ifnoerr ( const maxon::DataDictionary attributeString = descriptionStrings.GetEntry(ID)) { const maxon::String translatedString = attributeString.Get(maxon::DESCRIPTION::STRING::BASE::TRANSLATEDSTRING) iferr_return ; DiagnosticOutput ( "Name: \"@\" (@)" , translatedString, language.GetName()); } }
The resource IDs for basic data description settings are define in these namespaces:
For convenience one can use maxon::GetDefaultValueKey() to get the ID of maxon::DESCRIPTION::DATA::BASE::DEFAULTVALUE
String resource IDs are in defined in maxon::DESCRIPTION::STRING::BASE :
UI resource IDs are in defined in these namespaces: