当前位置: 首页>>代码示例>>C++>>正文


C++ SimpleStringCollection类代码示例

本文整理汇总了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());
}
开发者ID:dhbw-fn-micro,项目名称:cpputest,代码行数:7,代码来源:SimpleStringTest.cpp

示例2: fileFullPath

SimpleString FailableMemoryAllocator::getBaseName(const char* file)
{
    SimpleString fileFullPath(file);
    fileFullPath.replace('\\', '/');
    SimpleStringCollection pathElements;
    fileFullPath.split("/", pathElements);
    return pathElements[pathElements.size() - 1];
}
开发者ID:jkohvakk,项目名称:cpputest,代码行数:8,代码来源:TestMemoryAllocator.cpp

示例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;
    }
}
开发者ID:uecasm,项目名称:cpputest,代码行数:17,代码来源:SimpleString.cpp

示例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;
	}
}
开发者ID:conniechen19870216,项目名称:kavonUT,代码行数:18,代码来源:SimpleString.cpp

示例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;
    }
}
开发者ID:slagyr,项目名称:8LU-DSP,代码行数:22,代码来源:SimpleString.cpp

示例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;
	}
}
开发者ID:HackLinux,项目名称:KernelModuleTDDExperiment,代码行数:22,代码来源:SimpleString.cpp

示例7: amountOfLines

 size_t amountOfLines()
 {
     buffer_.split("\n", linesOfFile_);
     return linesOfFile_.size();
 }
开发者ID:BigShows,项目名称:cpputest,代码行数:5,代码来源:JUnitOutputTest.cpp


注:本文中的SimpleStringCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。