本文整理汇总了C++中wxString::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::Remove方法的具体用法?C++ wxString::Remove怎么用?C++ wxString::Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::Remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: edit_partit
wxString DescriptorFrame::edit_partit(wxString partit)
{
int erase_s=partit.Replace("<partitioning>","");
int erase_e=partit.Replace("</partitioning>","");
int erase_start=partit.find("<hostcollocation>");
while (erase_start>0)
{
erase_start=partit.find("<hostcollocation>");
int erase_end=partit.find("</hostcollocation>")+18;
if (erase_end>18)
{
partit.Remove(erase_start,erase_end-erase_start);
}
}
erase_start=0;
erase_start=partit.find("<processcollocation");
while (erase_start>0)
{
erase_start=partit.find("<processcollocation");
int erase_end=partit.find("</processcollocation>")+21;
if (erase_end>21)
{
partit.Remove(erase_start,erase_end-erase_start);
}
}
erase_start=0;
erase_start=partit.find("<homeplacement");
while (erase_start>0)
{
erase_start=1;
erase_start=partit.find("<homeplacement");
int erase_end=partit.find("</homeplacement>")+16;
if (erase_end>16)
{
partit.Remove(erase_start,erase_end-erase_start);
}
}
return partit;
}
示例2: SetContents
void Function::SetContents(wxString contents)
{
if(contents.Left(1) == '\n')
{
contents.Remove(0, 1);
}
if(contents.Right(1) == '\n')
{
contents.Remove(contents.Len() -1, 1);
}
m_functionContents = contents;
}
示例3: CompressedCachePath
wxString CompressedCachePath(wxString path)
{
#if defined(__WXMSW__)
int colon = path.find(':', 0);
path.Remove(colon, 1);
#endif
/* replace path separators with ! */
wxChar separator = wxFileName::GetPathSeparator();
for(unsigned int pos = 0; pos < path.size(); pos = path.find(separator, pos))
path.replace(pos, 1, _T("!"));
// Obfuscate the compressed chart file name, to (slightly) protect some encrypted raster chart data.
wxCharBuffer buf = path.ToUTF8();
unsigned char sha1_out[20];
sha1( (unsigned char *) buf.data(), strlen(buf.data()), sha1_out );
wxString sha1;
for (unsigned int i=0 ; i < 20 ; i++){
wxString s;
s.Printf(_T("%02X"), sha1_out[i]);
sha1 += s;
}
return g_Platform->GetPrivateDataDir() + separator + _T("raster_texture_cache") + separator + sha1;
}
示例4: ParseSnoozeTime
wxDateTime CReminderDialog::ParseSnoozeTime(wxString strTime)
{
// Parser function to parse something like: 1 Week 3 Days 5 Minutes.
wxDateTime dateTime = wxDateTime::Now();
strTime = strTime.Trim(true);
int weeks = 0, days = 0, hours = 0, minutes = 0;
wxRegEx reExp(wxT("\\s*(\\d+)\\s*([a-zA-Z]*)\\s*"), wxRE_ADVANCED);
wxString strNumber;
wxString strText;
int nNumber = 0;
while( reExp.Matches(strTime) )
{
strNumber = reExp.GetMatch(strTime, 1);
strText = reExp.GetMatch(strTime, 2);
strTime = strTime.Remove(0, reExp.GetMatch(strTime, 0).Length());
strText = strText.Lower();
try
{
nNumber = boost::lexical_cast<int>(strText.c_str());
}
catch (boost::bad_lexical_cast &)
{
nNumber = 0;
}
if(strText.Find(wxT("minute")) == 0)
minutes = nNumber;
else if(strText.Find(wxT("hour")) == 0)
hours = nNumber;
else if(strText.Find(wxT("day")) == 0)
days = nNumber;
else if(strText.Find(wxT("week")) == 0)
weeks = nNumber;
}
return dateTime + GetTimeSpan(weeks, days, hours, minutes);
}
示例5: addEvents
void EventWatcherFrame::addEvents(wxString& s)
{
// deselect all items so user can cleanly see what is added
for (int ix = 0; ix < (int)listbox_monitored->GetCount(); ++ix)
{
if (listbox_monitored->IsSelected(ix))
listbox_monitored->Deselect(ix);
}
while (true)
{
int p = s.Find("\n");
wxString s2;
if (p == -1)
s2 = s.Strip();
else
{
s2 = s.Left(p).Strip(wxString::both);
s.Remove(0, p);
s.Trim(false);
}
if (!s2.IsEmpty() && listbox_monitored->FindString(s2) == wxNOT_FOUND)
listbox_monitored->Select(listbox_monitored->Append(s2));
if (p == -1)
break;
}
updateControls();
}
示例6: StripQuotes
void StringUtil::StripQuotes(wxString &value){
size_t len = value.Length();
if (len > 0 && value[0] == '"' && value[len - 1] == '"'){
value.Remove(0,1);
value.RemoveLast(1);
value.Replace(STRING_DELIMITER_ESCAPE, STRING_DELIMETER, true);
}
}
示例7: ParseFindOutput
//////////////////////////////////////////////////////////////////////////////
/// private ParseFindOutput
/// This parsing can easily be broken! But, I am pretty confident
/// in the integrity of the string I'm parsing, because I know
/// what's coming in.
/// This does both files and directories because they are structured/listed
/// the same.
///
/// @param strng wxString The whole "find" output.
/// @param includeHidden bool Whether to include hidden things (./.foo)
/// in the dirlisting
///
/// @return wxArrayString return value.
///
/// @author David Czechowski @date 04-22-2004
//////////////////////////////////////////////////////////////////////////////
//Private:
wxArrayString Networking::ParseFindOutput(wxString strng, bool includeHidden)
{
wxArrayString r;
r.Empty();
while(strng.Length() > 2) {
// Get the "./"
char c1 = strng.GetChar(0); // peek
char c2 = strng.GetChar(1); // peek
strng.Remove(0,2); // pop
if(c1 == '.' && c2 == '\r') {
// Special case for . direcrtory
strng = "\r" + strng; // push it back on
c2 = '/';
}
//if(c1 != '.' && c2 != '/') {
// return r; // unexpected
//}
// Queue-up/Initialize for the loop
// There should be at least 2 left: \r\n
c1 = strng.GetChar(0);
c2 = strng.GetChar(1);
strng.Remove(0,2);
wxString newitem = "";
while(c1 != '\r' && c2 != '\n') {
newitem += c1;
c1 = c2;
c2 = strng.GetChar(0); // peek
strng.Remove(0,1); // pop
}
if(newitem != "") {
if(newitem.Left(1) != "." || includeHidden) {
r.Add(newitem);
}
}
}
return r;
}
示例8: RemoveBefore
inline void RemoveBefore(wxString &str, const wxString &s)
{
wxString::size_type pos = str.find(s);
if (pos != wxString::npos)
{
str.Remove(0, pos+s.length());
str.Trim(false);
}
}
示例9: GetCursorWord
bool ThreadSearch::GetCursorWord(wxString& sWord)
{
bool wordFound = false;
sWord = wxEmptyString;
// Gets active editor
cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if ( ed != NULL )
{
cbStyledTextCtrl* control = ed->GetControl();
sWord = control->GetSelectedText();
if (sWord != wxEmptyString)
{
sWord.Trim(true);
sWord.Trim(false);
wxString::size_type pos = sWord.find(wxT('\n'));
if (pos != wxString::npos)
{
sWord.Remove(pos, sWord.length() - pos);
sWord.Trim(true);
sWord.Trim(false);
}
return !sWord.IsEmpty();
}
// Gets word under cursor
int pos = control->GetCurrentPos();
int ws = control->WordStartPosition(pos, true);
int we = control->WordEndPosition(pos, true);
const wxString word = control->GetTextRange(ws, we);
if (!word.IsEmpty()) // Avoid empty strings
{
sWord.Clear();
while (--ws > 0)
{
const wxChar ch = control->GetCharAt(ws);
if (ch <= _T(' '))
continue;
else if (ch == _T('~'))
sWord << _T("~");
break;
}
// m_SearchedWord will be used if 'Find occurrences' ctx menu is clicked
sWord << word;
wordFound = true;
}
}
return wordFound;
}
示例10: ReadLineFromBuffer
wxString IniParser::ReadLineFromBuffer(wxString& buffer)
{
int len = buffer.Length();
int i = 0;
while (i < len && buffer.GetChar(i) != _T('\n'))
++i;
wxString str = buffer.Left(i);
while (i < len && (buffer.GetChar(i) == _T('\n') || buffer.GetChar(i) == _T('\r')))
++i;
buffer.Remove(0, i);
buffer.Trim();
return str;
}
示例11: ReadUntil
bool clEditorConfig::ReadUntil(wxChar delim, wxString& strLine, wxString& output)
{
while(!strLine.IsEmpty()) {
wxChar ch = strLine.at(0);
strLine.Remove(0, 1);
if(ch == delim) {
return true;
} else {
output << ch;
}
}
return false;
}
示例12: SSHExecSyncCommand
//////////////////////////////////////////////////////////////////////////////
/// private SSHExecSyncCommand
/// Passes the command off to PlinkConnect after appending a boolean test to
/// know if the command completely successfully.
///
/// @param command wxString command to execute
/// @param output wxString & output from the command.
///
/// @return bool Whether the call succeeded or not.
///
/// @author David Czechowski @date 04-22-2004
//////////////////////////////////////////////////////////////////////////////
//Private:
bool Networking::SSHExecSyncCommand(wxString command, wxString &output) {
command += " && echo Su_CC_ess-CMD";
output = m_plinks->executeSyncCommand(command);
int tokenPos = output.Find("Su_CC_ess-CMD");
if(tokenPos != -1) {
output.Remove(tokenPos);
return true;
}
// else
return false;
}
示例13: IsInsideString
bool nsHeaderFixUp::IsInsideString(wxString& Line)
{
int EndStringPos = Line.Find(_T('\"'));
bool OutsideString = false;
if ( EndStringPos == wxNOT_FOUND )
Line.Clear(); // Multi-line string -> skip line
else if ( EndStringPos > 0 )
{
if ( Line.GetChar(EndStringPos-1) == '\\' )
// Something like "\"cbMessageBox\"" -> remove \"
Line.Remove(0,EndStringPos+1);
else
OutsideString = true; // EndStringPos > 0
}
else
OutsideString = true; // EndStringPos = 0
if ( OutsideString ) // END Inside string
Line.Remove(0,EndStringPos+1);
return !OutsideString;
}
示例14: IsInsideMultilineComment
bool nsHeaderFixUp::IsInsideMultilineComment(wxString& Line)
{
int EndCommentPos = Line.Find(_T("*/"));
bool OutsideMultilineComment = false;
if ( EndCommentPos == wxNOT_FOUND )
Line.Clear(); // skip line
else
{
Line.Remove(0,EndCommentPos+2);
OutsideMultilineComment = true; // END Multiline comment
}
return !OutsideMultilineComment;
}
示例15: RemoveWhiteSpace
wxString RemoveWhiteSpace(wxString str)
{
int index = 0;
while(index < str.Len())
{
if(str.GetChar(index) == ' ' || str.GetChar(index) == '\t' || str.GetChar(index) == '\n')
{
str.Remove(index, 1);
}
else
{
index++;
}
}
return str;
}