本文整理汇总了C++中wxArrayString::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayString::erase方法的具体用法?C++ wxArrayString::erase怎么用?C++ wxArrayString::erase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayString
的用法示例。
在下文中一共展示了wxArrayString::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxSplitPath
// this function is used to properly interpret '..' in path
void wxSplitPath(wxArrayString& aParts, const wxString& path)
{
aParts.clear();
wxString strCurrent;
wxString::const_iterator pc = path.begin();
for ( ;; ) {
if ( pc == path.end() || *pc == wxCONFIG_PATH_SEPARATOR ) {
if ( strCurrent == wxT(".") ) {
// ignore
}
else if ( strCurrent == wxT("..") ) {
// go up one level
if ( aParts.size() == 0 )
{
wxLogWarning(_("'%s' has extra '..', ignored."), path);
}
else
{
aParts.erase(aParts.end() - 1);
}
strCurrent.Empty();
}
else if ( !strCurrent.empty() ) {
aParts.push_back(strCurrent);
strCurrent.Empty();
}
//else:
// could log an error here, but we prefer to ignore extra '/'
if ( pc == path.end() )
break;
}
else
strCurrent += *pc;
++pc;
}
}
示例2: wxSplitPath
// this function is used to properly interpret '..' in path
void wxSplitPath(wxArrayString& aParts, const wxChar *sz)
{
aParts.clear();
wxString strCurrent;
const wxChar *pc = sz;
for ( ;; ) {
if ( *pc == wxT('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) {
if ( strCurrent == wxT(".") ) {
// ignore
}
else if ( strCurrent == wxT("..") ) {
// go up one level
if ( aParts.size() == 0 )
wxLogWarning(_("'%s' has extra '..', ignored."), sz);
else
aParts.erase(aParts.end() - 1);
strCurrent.Empty();
}
else if ( !strCurrent.empty() ) {
aParts.push_back(strCurrent);
strCurrent.Empty();
}
//else:
// could log an error here, but we prefer to ignore extra '/'
if ( *pc == wxT('\0') )
break;
}
else
strCurrent += *pc;
pc++;
}
}