本文整理汇总了C++中wxString::GetChar方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::GetChar方法的具体用法?C++ wxString::GetChar怎么用?C++ wxString::GetChar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxString
的用法示例。
在下文中一共展示了wxString::GetChar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isNumeric
inline bool format::isNumeric(wxString kw) {
if(kw.Len()==0)
return false;
if(kw.GetChar(0)=='&') {
switch(kw.MakeLower().GetChar(1)) {
case 'b':
kw=kw.Mid(2);
break;
case 'o':
kw=kw.Mid(2);
break;
case 'h':
kw=kw.Mid(2);
break;
}
}
char ch;
for(int i=0;i<(int)kw.Len();i++) {
ch = kw.GetChar(i);
if( ch >= 46 && ch <= 57 ) {
if (ch==47)
return false;
}
else {
return false;
}
}
return true;
}
示例2: MakeBlockFilePath
wxFileName DirManager::MakeBlockFilePath(wxString value){
wxFileName dir;
dir.AssignDir(GetDataFilesDir());
if(value.GetChar(0)==wxT('d')){
// this file is located in a subdiretory tree
int location=value.Find(wxT('b'));
wxString subdir=value.Mid(0,location);
dir.AppendDir(subdir);
if(!dir.DirExists())dir.Mkdir();
}
if(value.GetChar(0)==wxT('e')){
// this file is located in a new style two-deep subdirectory tree
wxString topdir=value.Mid(0,3);
wxString middir=wxT("d");
middir.Append(value.Mid(3,2));
dir.AppendDir(topdir);
dir.AppendDir(middir);
if(!dir.DirExists())dir.Mkdir(0777,wxPATH_MKDIR_FULL);
}
return dir;
}
示例3: writeText
bool CDExtraGatewayRepeaterProtocolHandler::writeText(const wxString& text, LINK_STATUS status, const wxString& reflector)
{
unsigned char data[40U];
data[0] = 'D';
data[1] = 'S';
data[2] = 'R';
data[3] = 'P';
data[4] = 0x00;
::memset(data + 5U, ' ', 20U);
for (unsigned int i = 0U; i < text.Length() && i < 20U; i++)
data[i + 5U] = text.GetChar(i);
data[25U] = (unsigned char)status;
::memset(data + 26U, ' ', 8U);
if (status != LS_NONE) {
for (unsigned int i = 0U; i < reflector.Length() && i < 8U; i++)
data[i + 26U] = reflector.GetChar(i);
}
#if defined(DUMP_TX)
CUtils::dump(wxT("Sending Text"), data, 34U);
return true;
#else
return m_socket.write(data, 34U);
#endif
}
示例4: poll
bool CDPlusAuthenticator::poll(const wxString& callsign, const wxString& hostname, unsigned int port, unsigned char id)
{
CUDPReaderWriter socket(m_address, 0U);
bool ret = socket.open();
if (!ret)
return false;
unsigned char buffer[56U];
::memset(buffer, ' ', 56U);
buffer[0U] = 0x38U;
buffer[1U] = 0x20U;
buffer[2U] = 0x01U;
buffer[3U] = 0x01U;
for (unsigned int i = 0U; i < callsign.Len(); i++)
buffer[i + 4U] = callsign.GetChar(i);
buffer[12U] = 'D';
buffer[13U] = 'V';
buffer[14U] = '0';
buffer[15U] = '1';
buffer[16U] = '9';
buffer[17U] = '9';
buffer[18U] = '9';
buffer[19U] = '9';
for (unsigned int i = 0U; i < callsign.Len(); i++)
buffer[i + 20U] = callsign.GetChar(i);
buffer[28U] = 'W';
buffer[29U] = 'X';
buffer[30U] = 'I';
buffer[31U] = 'B';
buffer[32U] = id;
buffer[40U] = 'D';
buffer[41U] = 'H';
buffer[42U] = 'S';
buffer[43U] = '0';
buffer[44U] = '2';
buffer[45U] = '5';
buffer[46U] = '7';
in_addr address = socket.lookup(hostname);
if (address.s_addr == INADDR_NONE) {
socket.close();
return false;
}
ret = socket.write(buffer, 56U, address, port);
socket.close();
return ret;
}
示例5: ObtenerNumDeOperacion
usi interprete::ObtenerNumDeOperacion(wxString parentesis)
{
usi i=0,resul=0;
for(i=0;i<parentesis.length();i++)
{
if(parentesis.GetChar(i)=='+'||parentesis.GetChar(i)=='-'||parentesis.GetChar(i)=='*')
resul++;
}
return resul+1;
}
示例6: Move
bool wxExEx::Move(
const wxString& begin_address,
const wxString& end_address,
const wxString& destination)
{
if (m_STC->GetReadOnly())
{
return false;
}
const int dest_line = ToLineNumber(destination);
if (dest_line == 0)
{
return false;
}
if (!SetSelection(begin_address, end_address))
{
return false;
}
if (begin_address.StartsWith("'"))
{
if (begin_address.size() > 1)
{
MarkerDelete(begin_address.GetChar(1));
}
}
if (end_address.StartsWith("'"))
{
if (end_address.size() > 1)
{
MarkerDelete(end_address.GetChar(1));
}
}
m_STC->BeginUndoAction();
m_STC->Cut();
m_STC->GotoLine(dest_line - 1);
m_STC->Paste();
m_STC->EndUndoAction();
const int lines = wxExGetNumberOfLines(m_STC->GetSelectedText());
if (lines >= 2)
{
m_Frame->ShowExMessage(wxString::Format(_("%d lines moved"), lines));
}
return true;
}
示例7: setRepeaters
void CSplitRepeaterHeaderData::setRepeaters(const wxString& rpt1, const wxString& rpt2)
{
::memset(m_rptCall1, ' ', LONG_CALLSIGN_LENGTH);
::memset(m_rptCall2, ' ', LONG_CALLSIGN_LENGTH);
for (unsigned int i = 0U; i < rpt1.Len(); i++)
m_rptCall1[i] = rpt1.GetChar(i);
for (unsigned int i = 0U; i < rpt2.Len(); i++)
m_rptCall2[i] = rpt2.GetChar(i);
}
示例8: ObtenerNumCharsOperacion
usi interprete::ObtenerNumCharsOperacion(wxString parentesis)
{
usi i=0,resul=0;
for(i=0;i<parentesis.length();i++)
{
if(parentesis.GetChar(i)=='+'||parentesis.GetChar(i)=='-'||parentesis.GetChar(i)=='*')
break;
}
resul=i-1;
return resul;
}
示例9: CalculateLineNumber
int ToDoListView::CalculateLineNumber(const wxString& buffer, int upTo, int &oldline, int &oldlinepos )
{
for (; oldlinepos < upTo; ++oldlinepos)
{
if (buffer.GetChar(oldlinepos) == _T('\r') && buffer.GetChar(oldlinepos + 1) == _T('\n')) // CR+LF
continue; // we 'll count on \n (next loop)
else if (buffer.GetChar(oldlinepos) == _T('\r') || // CR only
buffer.GetChar(oldlinepos) == _T('\n')) // lf only
++oldline;
}
return oldline;
}
示例10: FirstSpecialChar
static size_t FirstSpecialChar(const wxString& str)
{
for (size_t pos = 0; pos < str.Len(); pos++) {
if (!str.GetChar(pos).IsAscii()) {
continue;
}
const unsigned char uc = str.GetChar(pos);
if (uc == 0x1f || uc == 0x1d || uc == 0x03 || uc == 0x02 || uc == 0x016 || uc == 0x0F) { //get all text until first irc color is found
return pos;
}
}
return -1;
}
示例11: 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;
}
示例12: aaSubSearch
void FindSequenceDialog::aaSubSearch ( const wxString &s , int start , int dir , wxString rf )
{
int a ;
wxChar codon[4] ;
codon[3] = 0 ;
wxString res ;
wxArrayInt ai ;
TVector *v = c->vec ;
wxString sub = getQuery() ;
int ostart = start < 0 ? 2 : 0 ;
res.Alloc ( s.length() / 3 + 10 ) ;
ai.Alloc ( s.length() / 3 + 10 ) ;
if ( start < 0 )
{
for ( start = -start ; start + 3 < s.length() ; start += 3 ) ;
}
for ( a = start ; a + dir * 2 >= 0 && a + dir * 2 < s.length() ; a += dir * 3 )
{
codon[0] = s.GetChar ( a ) ;
codon[1] = s.GetChar ( a + dir ) ;
codon[2] = s.GetChar ( a + dir * 2 ) ;
wxChar c2 = codonhash[codon] ;
if ( c2 < 'A' ) c2 = codonhash[codon] = v->dna2aa ( codon ) . GetChar ( 0 ) ;
res += c2 ;
ai.Add ( a ) ;
}
a = subsearch ( res , sub , 0 ) ;
//a = res.Find ( sub ) ;
while ( a != -1 )
{
if ( lb->GetCount() > FIND_MAX ) return ;
int from = ai[a] + 1 - ostart ;
int to = ai[a+sub.length()-1] + dir * 2 + 1 - ostart ;
if ( from > to ) { int z = from ; from = to ; to = z ; }
wxString msg = rf.BeforeFirst ( '\t' ) ;
lb->Append ( wxString::Format ( _T("%s: %s (%d-%d)") ,
txt("amino_acid").c_str() ,
msg.c_str() ,
from , to ) ) ;
vi.Add ( -1 ) ;
res.SetChar ( a , '_' ) ; // Invalidating
a = subsearch ( res , sub , a+1 ) ;
// a = res.Find ( sub ) ;
}
}
示例13: ParenNumCarac
usi interprete::ParenNumCarac(wxString parentesis)
{
usi i=0;
char a=parentesis.GetChar(0);
if(a=='('||a=='{')
{
for(i=0;i<parentesis.length();i++)
{
if(parentesis.GetChar(i)==',')
break;
}
}
return i;
}
示例14: MatchLine
bool TextFileSearcherText::MatchLine(wxString line)
{
bool match = false;
if ( m_MatchCase == false )
{
line.LowerCase();
}
int pos = line.Find(m_SearchText.c_str());
int nextPos;
while ( (match == false) && (pos >= 0) )
{
char c = ' '; // c is either the preceeding char or a virtual char
// that matches systematically the required conditions
match = true; // pos > 0 => expr found => Matches. Let's test start word
// and whole words conditions.
if ( (m_MatchWordBegin == true) || (m_MatchWord == true) )
{
if ( pos > 0 )
{
c = line.GetChar(pos - 1);
}
//match = (__iscsym(c) == 0);
match = !(isalnum(c) || ( c == '_' ));
}
if ( (match == true) && (m_MatchWord == true) )
{
c = ' ';
if ( (pos + m_SearchText.Length()) < line.Length() )
{
c = line.GetChar(pos + m_SearchText.Length());
}
match = !(isalnum(c) || ( c == '_' ));
}
nextPos = line.Mid(pos+1).Find(m_SearchText.c_str());
if ( nextPos >= 0 )
{
pos += nextPos + 1;
}
else
{
pos = -1;
}
}
return match;
}
示例15:
void CSplitRepeaterHeaderData::setMyCall1(const wxString& my1)
{
::memset(m_myCall1, ' ', LONG_CALLSIGN_LENGTH);
for (unsigned int i = 0U; i < my1.Len(); i++)
m_myCall1[i] = my1.GetChar(i);
}