当前位置: 首页>>代码示例>>C++>>正文


C++ wxString::GetChar方法代码示例

本文整理汇总了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;
}
开发者ID:bihai,项目名称:fbide,代码行数:29,代码来源:format.cpp

示例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;
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:26,代码来源:DirManager.cpp

示例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
}
开发者ID:chulochumo,项目名称:OpenDV,代码行数:32,代码来源:DExtraGatewayRepeaterProtocolHandler.cpp

示例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;
}
开发者ID:OZ1BV,项目名称:DMRRepeater,代码行数:56,代码来源:DPlusAuthenticator.cpp

示例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;
}
开发者ID:BackupTheBerlios,项目名称:hugoestudio,代码行数:10,代码来源:interprete.cpp

示例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;
}
开发者ID:Emmavw,项目名称:wxExtension,代码行数:54,代码来源:ex.cpp

示例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);
}
开发者ID:chulochumo,项目名称:OpenDV,代码行数:11,代码来源:SplitRepeaterHeaderData.cpp

示例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;
}
开发者ID:BackupTheBerlios,项目名称:hugoestudio,代码行数:11,代码来源:interprete.cpp

示例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;
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:12,代码来源:todolistview.cpp

示例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;
}
开发者ID:springlobby,项目名称:springlobby,代码行数:13,代码来源:chatpanel.cpp

示例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;
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:13,代码来源:cbiniparser.cpp

示例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 ) ;
		}    
	}    
开发者ID:magnusmanske,项目名称:gentle-m,代码行数:51,代码来源:FindSequenceDialog.cpp

示例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;
}
开发者ID:BackupTheBerlios,项目名称:hugoestudio,代码行数:14,代码来源:interprete.cpp

示例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;
}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:48,代码来源:TextFileSearcherText.cpp

示例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);
}
开发者ID:chulochumo,项目名称:OpenDV,代码行数:7,代码来源:SplitRepeaterHeaderData.cpp


注:本文中的wxString::GetChar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。