本文整理汇总了C++中LEReferenceTo::findLanguage方法的典型用法代码示例。如果您正苦于以下问题:C++ LEReferenceTo::findLanguage方法的具体用法?C++ LEReferenceTo::findLanguage怎么用?C++ LEReferenceTo::findLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LEReferenceTo
的用法示例。
在下文中一共展示了LEReferenceTo::findLanguage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findScript
LEReferenceTo<LangSysTable> ScriptListTable::findLanguage(const LETableReference &base, LETag scriptTag, LETag languageTag, LEErrorCode &success, le_bool exactMatch) const
{
const LEReferenceTo<ScriptTable> scriptTable = findScript(base, scriptTag, success);
if (scriptTable.isEmpty()) {
return LEReferenceTo<LangSysTable>();
}
return scriptTable->findLanguage(scriptTable, languageTag, success, exactMatch).reparent(base);
}
示例2: lookupListTable
LookupProcessor::LookupProcessor(const LETableReference &baseAddress,
Offset scriptListOffset, Offset featureListOffset, Offset lookupListOffset,
LETag scriptTag, LETag languageTag, const FeatureMap *featureMap, le_int32 featureMapCount, le_bool orderFeatures,
LEErrorCode& success)
: lookupListTable(), featureListTable(), lookupSelectArray(NULL), lookupSelectCount(0),
lookupOrderArray(NULL), lookupOrderCount(0), fReference(baseAddress)
{
LEReferenceTo<ScriptListTable> scriptListTable;
LEReferenceTo<LangSysTable> langSysTable;
le_uint16 featureCount = 0;
le_uint16 lookupListCount = 0;
le_uint16 requiredFeatureIndex = 0xFFFF;
if (LE_FAILURE(success)) {
return;
}
if (scriptListOffset != 0) {
scriptListTable = LEReferenceTo<ScriptListTable>(baseAddress, success, scriptListOffset);
langSysTable = scriptListTable->findLanguage(scriptListTable, scriptTag, languageTag, success);
if (langSysTable.isValid() && LE_SUCCESS(success)) {
featureCount = SWAPW(langSysTable->featureCount);
}
}
if (featureListOffset != 0) {
featureListTable = LEReferenceTo<FeatureListTable>(baseAddress, success, featureListOffset);
}
if (lookupListOffset != 0) {
lookupListTable = LEReferenceTo<LookupListTable>(baseAddress,success, lookupListOffset);
if(LE_SUCCESS(success) && lookupListTable.isValid()) {
lookupListCount = SWAPW(lookupListTable->lookupCount);
}
}
if (langSysTable.isEmpty() || featureListTable.isEmpty() || lookupListTable.isEmpty() ||
featureCount == 0 || lookupListCount == 0) {
return;
}
if(langSysTable.isValid()) {
requiredFeatureIndex = SWAPW(langSysTable->reqFeatureIndex);
}
lookupSelectArray = LE_NEW_ARRAY(FeatureMask, lookupListCount);
if (lookupSelectArray == NULL) {
success = LE_MEMORY_ALLOCATION_ERROR;
return;
}
for (int i = 0; i < lookupListCount; i += 1) {
lookupSelectArray[i] = 0;
}
lookupSelectCount = lookupListCount;
le_int32 count, order = 0;
le_uint32 featureReferences = 0;
LEReferenceTo<FeatureTable> featureTable;
LETag featureTag;
LEReferenceTo<FeatureTable> requiredFeatureTable;
LETag requiredFeatureTag = 0x00000000U;
// Count the total number of lookups referenced by all features. This will
// be the maximum number of entries in the lookupOrderArray. We can't use
// lookupListCount because some lookups might be referenced by more than
// one feature.
if(featureListTable.isValid() && LE_SUCCESS(success)) {
LEReferenceToArrayOf<le_uint16> featureIndexArray(langSysTable, success, langSysTable->featureIndexArray, featureCount);
for (le_uint32 feature = 0; LE_SUCCESS(success)&&(feature < featureCount); feature += 1) {
le_uint16 featureIndex = SWAPW(featureIndexArray.getObject(feature, success));
featureTable = featureListTable->getFeatureTable(featureListTable, featureIndex, &featureTag, success);
if (!featureTable.isValid() || LE_FAILURE(success)) {
continue;
}
featureReferences += SWAPW(featureTable->lookupCount);
}
}
if (!featureTable.isValid() || LE_FAILURE(success)) {
success = LE_INTERNAL_ERROR;
return;
}
if (requiredFeatureIndex != 0xFFFF) {
requiredFeatureTable = featureListTable->getFeatureTable(featureListTable, requiredFeatureIndex, &requiredFeatureTag, success);
if (LE_FAILURE(success)) return;
featureReferences += SWAPW(requiredFeatureTable->lookupCount);
}
lookupOrderArray = LE_NEW_ARRAY(le_uint16, featureReferences);
if (lookupOrderArray == NULL) {
success = LE_MEMORY_ALLOCATION_ERROR;
return;
}
//.........这里部分代码省略.........