本文整理汇总了C++中StringBuffer::ToCStr方法的典型用法代码示例。如果您正苦于以下问题:C++ StringBuffer::ToCStr方法的具体用法?C++ StringBuffer::ToCStr怎么用?C++ StringBuffer::ToCStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringBuffer
的用法示例。
在下文中一共展示了StringBuffer::ToCStr方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OVRError
OVRError::OVRError(ovrResult code, const char* pFormat, ...)
: OVRError(code)
{
va_list argList;
va_start(argList, pFormat);
StringBuffer strbuff;
strbuff.AppendFormatV(pFormat, argList);
SetDescription(strbuff.ToCStr());
va_end(argList);
}
示例2: MakeError
OVRError MakeError(ovrResult errorCode, ovrSysErrorCode sysCode, const char* pSourceFile,
int sourceLine, bool logError, bool assertError, const char* pContext, const char* pDescriptionFormat, ...)
{
OVRError ovrError(errorCode);
ovrError.SetCurrentValues(); // Sets the current time, etc.
ovrError.SetSysCode(sysCode);
va_list argList;
va_start(argList, pDescriptionFormat);
StringBuffer strbuff;
strbuff.AppendFormatV(pDescriptionFormat, argList);
va_end(argList);
ovrError.SetDescription(strbuff.ToCStr());
ovrError.SetContext(pContext);
ovrError.SetSource(pSourceFile, sourceLine);
// Set the TLS last error.
LastErrorTLS::GetInstance()->LastError() = ovrError;
int silencerOptions = ovrlog::ErrorSilencer::GetSilenceOptions();
if (silencerOptions & ovrlog::ErrorSilencer::CompletelySilenceLogs)
{
logError = false;
}
if (silencerOptions & ovrlog::ErrorSilencer::PreventErrorAsserts)
{
assertError = false;
}
// If logging the error:
if (logError)
{
Logger.LogError(ovrError.GetDescription().ToCStr());
}
// If asserting the error:
if (assertError)
{
// Assert in debug mode to alert unit tester/developer of the error as it occurs.
OVR_FAIL_M(ovrError.GetDescription().ToCStr());
}
if (ErrorCallback)
{
const bool quiet = !logError && !assertError;
ErrorCallback(ovrError, quiet);
}
return ovrError;
}
示例3:
String::String(const StringBuffer& src)
{
pData = AllocDataCopy1(src.GetSize(), 0, src.ToCStr(), src.GetSize());
}
示例4: pData
StringBuffer::StringBuffer(const StringBuffer& src)
: pData(NULL), Size(0), BufferSize(src.GetGrowSize()), GrowSize(OVR_SBUFF_DEFAULT_GROW_SIZE), LengthIsSize(false)
{
AppendString(src.ToCStr(), src.GetSize());
LengthIsSize = src.LengthIsSize;
}
示例5: GetData
void String::operator = (const StringBuffer& src)
{
DataDesc* polddata = GetData();
SetData(AllocDataCopy1(src.GetSize(), 0, src.ToCStr(), src.GetSize()));
polddata->Release();
}
示例6:
void StringBuffer::operator = (const StringBuffer& src)
{
Clear();
AppendString(src.ToCStr(), src.GetSize());
}