本文整理汇总了C++中Strings::peek方法的典型用法代码示例。如果您正苦于以下问题:C++ Strings::peek方法的具体用法?C++ Strings::peek怎么用?C++ Strings::peek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strings
的用法示例。
在下文中一共展示了Strings::peek方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Stringses_to_StringsIndex
autoStringsIndex Stringses_to_StringsIndex (Strings me, Strings classes) {
try {
autoStringsIndex tmp = Strings_to_StringsIndex (classes);
long numberOfClasses = tmp -> classes -> size;
autoStringsIndex him = StringsIndex_create (my numberOfStrings);
for (long i = 1; i <= numberOfClasses; i++) {
SimpleString t = (SimpleString) tmp -> classes -> item[i];
autoSimpleString t2 = Data_copy (t);
Collection_addItem_move (his classes.peek(), t2.move());
}
for (long j = 1; j <= my numberOfStrings; j++) {
long index = 0;
char32 *stringsj = my strings[j];
for (long i = 1; i <= numberOfClasses; i++) {
SimpleString ss = (SimpleString) his classes -> item[i];
if (Melder_cmp (stringsj, ss -> string) == 0) {
index = i;
break;
}
}
his classIndex[j] = index;
}
return him;
} catch (MelderError) {
Melder_throw (me, U": no StringsIndex created.");
}
}