本文整理汇总了C++中SimpleStringCollection类的典型用法代码示例。如果您正苦于以下问题:C++ SimpleStringCollection类的具体用法?C++ SimpleStringCollection怎么用?C++ SimpleStringCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SimpleStringCollection类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST
TEST(SimpleString, CollectionWritingToEmptyString)
{
SimpleStringCollection col;
col.allocate(3);
col[3] = SimpleString("HAH");
STRCMP_EQUAL("", col[3].asCharString());
}
示例2: fileFullPath
SimpleString FailableMemoryAllocator::getBaseName(const char* file)
{
SimpleString fileFullPath(file);
fileFullPath.replace('\\', '/');
SimpleStringCollection pathElements;
fileFullPath.split("/", pathElements);
return pathElements[pathElements.size() - 1];
}
示例3: split
void SimpleString::split(const SimpleString& delimiter, SimpleStringCollection& col) const
{
size_t num = count(delimiter);
size_t extraEndToken = (endsWith(delimiter)) ? 0 : 1U;
col.allocate(num + extraEndToken);
char* str = buffer_;
char* prev;
for (size_t i = 0; i < num; ++i) {
prev = str;
str = StrStr(str, delimiter.buffer_) + 1;
col[i] = SimpleString(prev).subString(0, size_t (str - prev));
}
if (extraEndToken) {
col[num] = str;
}
}
示例4: split
void SimpleString::split(const SimpleString& delimiter, SimpleStringCollection& col) const
{
size_t num = count(delimiter);
size_t extraEndToken = (endsWith(delimiter)) ? 0 : 1U;
col.allocate(num + extraEndToken);
char* str = buffer_;
char* prev;
for (size_t i = 0; i < num; ++i) {
prev = str;
str = PlatformSpecificStrStr(str, delimiter.buffer_) + 1;
size_t len = (size_t) (str - prev) + 1;
col[i].buffer_ = copyToNewBuffer(prev, len);
}
if (extraEndToken) {
col[num] = str;
}
}
示例5: split
void SimpleString::split(const SimpleString& split, SimpleStringCollection& col) const
{
int num = count(split);
int extraEndToken = (endsWith(split)) ? 0 : 1;
col.allocate(num + extraEndToken);
char* str = buffer;
char* prev;
for (int i = 0; i < num; ++i) {
prev = str;
str = PlatformSpecificStrStr(str, split.buffer) + 1;
int len = str - prev;
char* sub = allocString(len+1);
PlatformSpecificStrNCpy(sub, prev, len);
sub[len] = '\0';
col[i] = sub;
deallocString(sub);
}
if (extraEndToken) {
col[num] = str;
}
}
示例6: split
void SimpleString::split(const SimpleString& delimiter, SimpleStringCollection& col) const
{
size_t num = count(delimiter);
size_t extraEndToken = (endsWith(delimiter)) ? 0 : 1;
col.allocate(num + extraEndToken);
char* str = buffer_;
char* prev;
for (size_t i = 0; i < num; ++i) {
prev = str;
str = PlatformSpecificStrStr(str, delimiter.buffer_) + 1;
size_t len = str - prev;
char* sub = allocStringBuffer(len + 1);
PlatformSpecificStrNCpy(sub, prev, len);
sub[len] = '\0';
col[i] = sub;
deallocStringBuffer(sub);
}
if (extraEndToken) {
col[num] = str;
}
}
示例7: amountOfLines
size_t amountOfLines()
{
buffer_.split("\n", linesOfFile_);
return linesOfFile_.size();
}