本文整理汇总了C++中TString::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ TString::clear方法的具体用法?C++ TString::clear怎么用?C++ TString::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TString
的用法示例。
在下文中一共展示了TString::clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: super
CVec2PropertyDescription::CVec2PropertyDescription(CSerializer* pSerializer)
: super(NULL)
{
SetType(eRPT_Vec2F);
SetMaxCount(VEC_COUNT);
SetFixed(true);
CPropertyDescriptionBase* pFloatProperty = CComponentProxyManager::GetInstance()->CreateProperty(eRPT_Float, NULL);
SetTemplateProperty(pFloatProperty);
TString InitValue = _T("0,0");
if (pSerializer != NULL)
{
InitValue.clear();
for (size_t i = 0; i < VEC_COUNT; ++i)
{
float fValue = 0;
(*pSerializer) >> fValue;
InitValue.append(wxString::Format(_T("%f"),fValue));
if (i != VEC_COUNT - 1)
{
InitValue.append(_T(","));
}
CPropertyDescriptionBase* pChild = AddChild(NULL);
pChild->InitializeValue(fValue);
}
ResetChildName();
}
示例2: CheckExceptionMessage
bool CheckExceptionMessage(const char* msg, TString& err) {
static const char* badMsg[] = {
// Операция успешно завершена [cp1251]
"\xce\xef\xe5\xf0\xe0\xf6\xe8\xff\x20\xf3\xf1\xef\xe5\xf8\xed\xee\x20\xe7\xe0\xe2\xe5\xf0\xf8\xe5\xed\xe0",
"The operation completed successfully",
"No error"};
err.clear();
if (msg == nullptr) {
err = "Error message is null";
return false;
}
if (IsSpace(msg)) {
err = "Error message is empty";
return false;
}
for (auto& i : badMsg) {
if (strstr(msg, i) != nullptr) {
err = "Invalid error message: " + TString(msg);
return false;
}
}
return true;
}
示例3: super
CVec4PropertyDescription::CVec4PropertyDescription(CSerializer* pSerializer)
: super(NULL)
{
SetType(eRPT_Vec4F);
SetMaxCount(VEC_COUNT);
CFloatPropertyDescription* pFloatProperty = down_cast<CFloatPropertyDescription*>(CComponentProxyManager::GetInstance()->CreateProperty(eRPT_Float, NULL));
pFloatProperty->SetSpinStep(0.1f);
SetTemplateProperty(pFloatProperty);
TString InitValue = _T("0,0,0,0");
if (pSerializer != NULL)
{
InitValue.clear();
for (uint32_t i = 0; i < VEC_COUNT; ++i)
{
float fValue = 0;
(*pSerializer) >> fValue;
InitValue.append(wxString::Format(_T("%f"),fValue));
if (i != VEC_COUNT - 1)
{
InitValue.append(_T(","));
}
CPropertyDescriptionBase* pChild = InsertChild(NULL);
pChild->InitializeValue(fValue);
}
ResetChildName();
}
示例4: readParameters
//------------------------------------------------------------------------------
// bool ParamsReader::readParameters()
//------------------------------------------------------------------------------
void ParamsReader::readParameters()
{
TRACE("ParamsReader::readParameters -->");
TString t;
for (bool tokenRead = file_reader->firstLine(t); tokenRead ;
tokenRead = file_reader->nextLine(t))
{
token_list.push_back(t);
t.clear();
}
TRACE("ParamsReader::readParameters <--");
}
示例5: int
void DumpFile( LPTSTR lpFilename ){
BUFFER buf;
if( LoadFileData(lpFilename, buf) )
{
m_wndList.DeleteAllItems();
TString str;
int item = 0;
unsigned idx = 0;
unsigned siz = buf.size();
while( idx < siz )
{
int loop = 16;
if( int(siz - idx) < 16 ){
loop = int(siz - idx);
}
str.Format(_T("%08X"), idx);
m_wndList.InsertItem(item, (LPTSTR)str);
for( int i=0; i<loop; i++ ){
str.Format(_T("%02X"), buf.at(idx+i));
m_wndList.SetItem(item, i+1, (LPTSTR)str);
}
str.clear();
for( int i=0; i<loop; i++ ){
if( ::isgraph(int(buf.at(idx+i))) )
str.AppendFormat(_T("%c"), buf.at(idx+i));
else
str.AppendFormat(_T(" "));
}
m_wndList.SetItem(item, 17, (LPTSTR)str);
idx += 16;
item += 1;
}
}
}