本文整理汇总了C++中common::StringArray::remove_at方法的典型用法代码示例。如果您正苦于以下问题:C++ StringArray::remove_at方法的具体用法?C++ StringArray::remove_at怎么用?C++ StringArray::remove_at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::StringArray
的用法示例。
在下文中一共展示了StringArray::remove_at方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bind
/*
bind accept the following input formats:
1 - [S].slide.[L]{.[C]}
2 - [L]{.[C]}
where:
[S] is the slide to be shown
[L] is the location to switch to (immediately in case 2, or right after slide [S] in case 1)
[C] is the character to be selected, and is optional
The routine tells one form from the other by searching for the '.slide.'
NOTE: there exists one script in which [L] is not used in the case 1, but its use
is commented out, and would definitely crash the current implementation.
*/
void LocationName::bind(const char *s) {
free(_buf);
_buf = strdup(s);
_hasSlide = false;
_hasCharacter = false;
Common::StringArray list;
char *tok = strtok(_buf, ".");
while (tok) {
list.push_back(tok);
tok = strtok(NULL, ".");
}
if (list.size() < 1 || list.size() > 4)
error("changeLocation: ill-formed location name '%s'", s);
if (list.size() > 1) {
if (list[1] == "slide") {
_hasSlide = true;
_slide = list[0];
list.remove_at(0); // removes slide name
list.remove_at(0); // removes 'slide'
}
if (list.size() == 2) {
_hasCharacter = true;
_character = list[1];
}
}
_location = list[0];
strcpy(_buf, s); // kept as reference
}