本文整理汇总了C++中StringBuilder::AsCString方法的典型用法代码示例。如果您正苦于以下问题:C++ StringBuilder::AsCString方法的具体用法?C++ StringBuilder::AsCString怎么用?C++ StringBuilder::AsCString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuilder
的用法示例。
在下文中一共展示了StringBuilder::AsCString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppendLine
RF_Type::Bool AppendLine()
{
StringBuilder builder;
builder.AppendLine();
return builder.Length() == 0 && builder.Size() == 1 &&
builder.Capacity() >= 1 && builder.AsCString() != 0 &&
builder.AsCString()[0] == '\0';
}
示例2: Append
RF_Type::Bool Append()
{
StringBuilder builder;
builder.Append("Hi");
return builder.Length() == 2 && builder.Size() == 3 &&
builder.Capacity() >= 3 && builder.AsCString() != 0 &&
builder.AsCString()[0] == 'H' && builder.AsCString()[1] == 'i' &&
builder.AsCString()[2] == '\0';
}
示例3: Insert
RF_Type::Bool Insert()
{
StringBuilder builder;
builder.Insert("Hello !",0);
builder.Insert("World", 6);
return builder.Length() == 12 && builder.Size() == 13 &&
builder.Capacity() >= 13 && builder.AsCString()[6] == 'W' &&
builder.AsCString()[11] == '!';
}
示例4: AppendFormat
RF_Type::Bool AppendFormat()
{
StringBuilder builder;
builder.AppendFormat("Hello %s!", "World");
return builder.Length() == 12 && builder.Size() == 13 &&
builder.Capacity() >= 13 && builder.AsCString() != 0;
}
示例5: Destructor
RF_Type::Bool Destructor()
{
StringBuilder builder;
builder.~StringBuilder();
return builder.AsCString() == 0 && builder.Length() == 0 &&
builder.Size() == 0 && builder.Capacity() == 0;
}
示例6: Replace
RF_Type::Bool Replace()
{
StringBuilder builder;
builder.Append("Hello W!");
builder.Replace("W", "World");
return builder.Length() == 12 && builder.Size() == 13 &&
builder.Capacity() >= 13 && builder.AsCString()[7] == 'o';
}
示例7: Remove
RF_Type::Bool Remove()
{
StringBuilder builder;
builder.Append("Hello World!");
builder.Remove(6, 5);
return builder.Length() == 7 && builder.Size() == 8 &&
builder.Capacity() >= 8 && builder.AsCString()[6] == '!';
}
示例8: AsCString
RF_Type::Bool AsCString()
{
StringBuilder builder;
builder.Append("Hi");
return builder.AsCString()[0] == 'H' && builder.AsCString()[1] == 'i';
}