本文整理汇总了C++中NamespaceDetails::_catalogFindIndexByName方法的典型用法代码示例。如果您正苦于以下问题:C++ NamespaceDetails::_catalogFindIndexByName方法的具体用法?C++ NamespaceDetails::_catalogFindIndexByName怎么用?C++ NamespaceDetails::_catalogFindIndexByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NamespaceDetails
的用法示例。
在下文中一共展示了NamespaceDetails::_catalogFindIndexByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void run() {
NamespaceDetails* nsd = nsdetails( _ns );
// _id_ is at 0, so nIndexes == 1
IndexCatalog::IndexBuildBlock* a = halfAddIndex("a");
IndexCatalog::IndexBuildBlock* b = halfAddIndex("b");
IndexCatalog::IndexBuildBlock* c = halfAddIndex("c");
IndexCatalog::IndexBuildBlock* d = halfAddIndex("d");
int offset = nsd->_catalogFindIndexByName( "b_1", true );
ASSERT_EQUALS(2, offset);
delete b;
ASSERT_EQUALS(2, nsd->_catalogFindIndexByName( "c_1", true ) );
ASSERT_EQUALS(3, nsd->_catalogFindIndexByName( "d_1", true ) );
offset = nsd->_catalogFindIndexByName( "d_1", true );
delete d;
ASSERT_EQUALS(2, nsd->_catalogFindIndexByName( "c_1", true ) );
ASSERT( nsd->_catalogFindIndexByName( "d_1", true ) < 0 );
offset = nsd->_catalogFindIndexByName( "a_1", true );
delete a;
ASSERT_EQUALS(1, nsd->_catalogFindIndexByName( "c_1", true ));
delete c;
}