本文整理汇总了C++中TTAddress::listNameInstance方法的典型用法代码示例。如果您正苦于以下问题:C++ TTAddress::listNameInstance方法的具体用法?C++ TTAddress::listNameInstance怎么用?C++ TTAddress::listNameInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTAddress
的用法示例。
在下文中一共展示了TTAddress::listNameInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: append
TTErr TTAddressItem::append(TTAddress addressToAppend, TTAddressItemPtr *returnedItem)
{
TTAddressItemPtr anItem = this;
TTAddressItemPtr nextItem;
TTList nameInstanceList;
TTSymbol nameInstance(kTTSymEmpty);
addressToAppend.listNameInstance(nameInstanceList);
for (nameInstanceList.begin(); nameInstanceList.end(); nameInstanceList.next()) {
nameInstance = nameInstanceList.current()[0];
nextItem = anItem->getItem(nameInstance);
if (!nextItem) {
nextItem = new TTAddressItem(nameInstance, anItem);
((TTListPtr)anItem)->append((TTPtr)nextItem);
}
anItem = nextItem;
}
anItem->options->appendUnique(addressToAppend.getAttribute());
*returnedItem = anItem;
return kTTErrNone;
}
示例2: find
TTErr TTAddressItem::find(TTAddress addressToFind, TTAddressItemPtr *returnedItem)
{
TTAddressItemPtr anItem = this;
TTAddressItemPtr nextItem;
TTList nameInstanceList;
TTSymbol nameInstance(kTTSymEmpty);
TTValue v;
addressToFind.listNameInstance(nameInstanceList);
if (nameInstanceList.isEmpty())
return kTTErrGeneric;
for (nameInstanceList.begin(); nameInstanceList.end(); nameInstanceList.next()) {
nameInstance = nameInstanceList.current()[0];
nextItem = anItem->getItem(nameInstance);
if (!nextItem)
return kTTErrValueNotFound;
else
anItem = nextItem;
}
if (anItem->options->isEmpty() && addressToFind.getAttribute() == NO_ATTRIBUTE) {
*returnedItem = anItem;
return kTTErrNone;
}
if (!anItem->options->findEquals(addressToFind.getAttribute(), v)) {
*returnedItem = anItem;
return kTTErrNone;
}
return kTTErrValueNotFound;
}