本文整理汇总了C++中StringStorage::split方法的典型用法代码示例。如果您正苦于以下问题:C++ StringStorage::split方法的具体用法?C++ StringStorage::split怎么用?C++ StringStorage::split使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringStorage
的用法示例。
在下文中一共展示了StringStorage::split方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void VideoRegionsConfigDialog::apply()
{
// FIXME: Bad code
AutoLock al(m_config);
//
// Clear old video classes names container
//
StringVector *videoClasses = m_config->getVideoClassNames();
videoClasses->clear();
std::vector<Rect> *videoRects = m_config->getVideoRects();
videoRects->clear();
//
// Split text from text area to string array
//
StringStorage classNames;
m_videoClasses.getText(&classNames);
size_t count = 0;
TCHAR delimiters[] = _T(" \n\r\t,;");
classNames.split(delimiters, NULL, &count);
if (count != 0) {
std::vector<StringStorage> chunks(count);
classNames.split(delimiters, &chunks.front(), &count);
for (size_t i = 0; i < count; i++) {
if (!chunks[i].isEmpty()) {
videoClasses->push_back(chunks[i].getString());
}
}
}
StringStorage videoRectsStringStorage;
m_videoRects.getText(&videoRectsStringStorage);
count = 0;
videoRectsStringStorage.split(delimiters, NULL, &count);
if (count != 0) {
std::vector<StringStorage> chunks(count);
videoRectsStringStorage.split(delimiters, &chunks.front(), &count);
for (size_t i = 0; i < count; i++) {
if (!chunks[i].isEmpty()) {
try {
videoRects->push_back(RectSerializer::toRect(&chunks[i]));
} catch (...) {
// Ignore wrong formatted strings
}
}
}
}
//
// TODO: Create parseUInt method
//
StringStorage vriss;
m_videoRecognitionInterval.getText(&vriss);
int interval;
StringParser::parseInt(vriss.getString(), &interval);
m_config->setVideoRecognitionInterval((unsigned int)interval);
}