本文整理汇总了C++中STRING::GetBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ STRING::GetBuffer方法的具体用法?C++ STRING::GetBuffer怎么用?C++ STRING::GetBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STRING
的用法示例。
在下文中一共展示了STRING::GetBuffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Parse
void DATE::Parse(const STRING& aString)
{
UErrorCode errorCode = U_ZERO_ERROR;
UnicodeString formatSpec(L"d/M/yy K:mm a");
SimpleDateFormat dateFormat(formatSpec, errorCode);
if(U_FAILURE(errorCode))
{
STRING reason;
SafeSprintf(reason, L"Failed to get a SimpleDateFormat for parse() in Date::Parse, reason (%i): %S", errorCode, u_errorName(errorCode));
throw new PARSEEXCEPTION(reason);
}
UnicodeString unicodeString(aString.GetBuffer());
UDate uDate = dateFormat.parse(unicodeString, errorCode);
if(U_FAILURE(errorCode))
{
STRING reason;
SafeSprintf(reason, L"Parse exception in MUSIC::Parse, reason (%i): %S", errorCode, u_errorName(errorCode));
throw new PARSEEXCEPTION("Parse exception in MUSIC::Parse");
}
//delete dateFormat;
Value = (fitINT64) uDate;
}
示例2: Write
void ceefit_call_spec OUTWRITER::Write(const STRING& aString)
{
if(IsClosed != true)
{
printf("%S", aString.GetBuffer());
}
else
{
throw new IOEXCEPTION("Bug: OUTWRITER closed, should not write.");
}
}
示例3: Failure
// special form of exception for CeeFIT system failures
void ceefit_call_spec FIXTURE::Failure(PTR<PARSE>& cell, FAILURE* f)
{
STRING message;
message = STRING("A failure occurred: ") + (f != null ? f->GetReason() : STRING("<unknown reason>"));
# ifdef _DEBUG
printf("%S\n", message.GetBuffer());
# endif
Error(cell, message);
delete f;
}
示例4: Exception
void ceefit_call_spec FIXTURE::Exception(PTR<PARSE>& cell, EXCEPTION* e)
{
STRING message;
message = STRING("An unhandled exception occurred: ") + (e != null ? e->GetReason() : STRING("<unknown reason>"));
# ifdef _DEBUG
printf("%S\n", message.GetBuffer());
# endif
Error(cell, message);
delete e;
}