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


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

本文整理汇总了C++中wxString::Len方法的典型用法代码示例。如果您正苦于以下问题:C++ wxString::Len方法的具体用法?C++ wxString::Len怎么用?C++ wxString::Len使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxString的用法示例。


在下文中一共展示了wxString::Len方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FindEndOfSymbol

int wxStringFormatter::FindEndOfSymbol(wxString input)
{
	int pos = input.find_first_of(DELIMS);

	if(pos == wxNOT_FOUND)
	{
		return input.Len()-1;
	}
	return pos - 1;
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:10,代码来源:stringformatter.cpp

示例2:

CSplitRepeaterHeaderData::CSplitRepeaterHeaderData(const wxString& myCall1,  const wxString& myCall2, const wxString& yourCall,
						 const wxString& rptCall1, const wxString& rptCall2, unsigned char flag1,
						 unsigned char flag2, unsigned char flag3) :
m_id(0U),
m_flag1(flag1),
m_flag2(flag2),
m_flag3(flag3),
m_myCall1(NULL),
m_myCall2(NULL),
m_yourCall(NULL),
m_rptCall1(NULL),
m_rptCall2(NULL),
m_address(),
m_port(0U),
m_errors(0U)
{
	m_myCall1  = new unsigned char[LONG_CALLSIGN_LENGTH];
	m_myCall2  = new unsigned char[SHORT_CALLSIGN_LENGTH];
	m_yourCall = new unsigned char[LONG_CALLSIGN_LENGTH];
	m_rptCall1 = new unsigned char[LONG_CALLSIGN_LENGTH];
	m_rptCall2 = new unsigned char[LONG_CALLSIGN_LENGTH];

	::memset(m_myCall1,  ' ', LONG_CALLSIGN_LENGTH);
	::memset(m_myCall2,  ' ', SHORT_CALLSIGN_LENGTH);
	::memset(m_yourCall, ' ', LONG_CALLSIGN_LENGTH);
	::memset(m_rptCall1, ' ', LONG_CALLSIGN_LENGTH);
	::memset(m_rptCall2, ' ', LONG_CALLSIGN_LENGTH);

	for (unsigned int i = 0U; i < myCall1.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		m_myCall1[i] = myCall1.GetChar(i);

	for (unsigned int i = 0U; i < myCall2.Len() && i < SHORT_CALLSIGN_LENGTH; i++)
		m_myCall2[i] = myCall2.GetChar(i);

	for (unsigned int i = 0U; i < yourCall.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		m_yourCall[i] = yourCall.GetChar(i);

	for (unsigned int i = 0U; i < rptCall1.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		m_rptCall1[i] = rptCall1.GetChar(i);

	for (unsigned int i = 0U; i < rptCall2.Len() && i < LONG_CALLSIGN_LENGTH; i++)
		m_rptCall2[i] = rptCall2.GetChar(i);
}
开发者ID:chulochumo,项目名称:OpenDV,代码行数:43,代码来源:SplitRepeaterHeaderData.cpp

示例3: Process

void wxVideoTerminal::Process(wxString str)
{
	unsigned int i;
	for (i=0; i<str.Len(); ++i)
		Consume(str.GetChar(i));

	m_counter_blink = 0;
	m_cursor_blink = true;
	Refresh(false);
}
开发者ID:firodj,项目名称:alumetro-wx,代码行数:10,代码来源:VideoTerminal.cpp

示例4: ParseJSON

Object RaceAnalyzerComm::ParseJSON(wxString &json){

	Object root;
	std::stringstream stream;
	for (size_t i = 0; i < json.Len(); i++){
		stream.put(json.ToAscii()[i]);
	}
	Reader::Read(root, stream);
	return root;
}
开发者ID:autosportlabs,项目名称:RaceAnalyzer,代码行数:10,代码来源:comm.cpp

示例5: OutputEscapedString

// Same as above, but create entities first.
// Translates '<' to "&lt;", '>' to "&gt;" and so on, according to the spec:
// http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping
static void OutputEscapedString(wxOutputStream& stream,
                                const wxString& str,
                                wxMBConv *convMem,
                                wxMBConv *convFile,
                                EscapingMode mode)
{
    const size_t len = str.Len();

    wxString escaped;
    escaped.reserve( len );

    for (size_t i = 0; i < len; i++)
    {
        const wxChar c = str.GetChar(i);

        switch ( c )
        {
            case '<':
                escaped.append(wxT("&lt;"));
                break;
            case '>':
                escaped.append(wxT("&gt;"));
                break;
            case '&':
                escaped.append(wxT("&amp;"));
                break;
            case '\r':
                escaped.append(wxT("&#xD;"));
                break;
            default:
                if ( mode == Escape_Attribute )
                {
                    switch ( c )
                    {
                        case '"':
                            escaped.append(wxT("&quot;"));
                            break;
                        case '\t':
                            escaped.append(wxT("&#x9;"));
                            break;
                        case '\n':
                            escaped.append(wxT("&#xA;"));
                            break;
                        default:
                            escaped.append(c);
                    }
                }
                else
                {
                    escaped.append(c);
                }
        }
    }
    OutputString(stream, escaped, convMem, convFile);
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:58,代码来源:xml.cpp

示例6: StrToItemIntegerType

bool CUtils::StrToItemIntegerType(const wxString & str, long &d)
{
    wxChar *pEnd;

    errno = 0;

    bool bHex = (str.Len() > 2 && str[0] == wxT('0') && (str[1] == wxT('x') || str[1] == wxT('X')));

    d = wxStrtol(str, &pEnd, bHex ? 16 : 10);
    return (errno == 0 && (*pEnd == wxT('\0')));
}
开发者ID:MaurodeLyon,项目名称:Embedded-Software-Ontwikkeling,代码行数:11,代码来源:utils.cpp

示例7: ContainsInvalidPathChars

bool Utils::ContainsInvalidPathChars(wxString path, bool allowExclamationMark)
{
	for (size_t i = 0; i < path.Len(); i++)
	{
		if (wxFileName::GetForbiddenChars().Contains(path[i]) || !(allowExclamationMark || path[i] != '!'))
		{
			return true;
		}
	}
	return false;
}
开发者ID:Kuchikixx,项目名称:MultiMC4,代码行数:11,代码来源:apputils.cpp

示例8: ReverseFind

/****************************************************************************
REMARKS:
None of the Reverse Find functions in wxWindows appear to work in a way that
can be used by our code. This includes the libstr rfind implementations which
do not correctly pass the given return value.
****************************************************************************/
int ReverseFind(
    const wxString &tstr,
    const wxString &str,
    int start = -1)
{
    wxASSERT( str.GetStringData()->IsValid() );

    // TODO could be made much quicker than that
    int p = tstr.Len()-str.Len()-1;
    int p2 = start-str.Len();

    // if the user supplied a valid start point, use it
    if (start != -1 && p > p2) p = p2;
    while ( p >= 0 ) {
        if ( wxStrncmp(tstr.c_str() + p, str.c_str(), str.Len()) == 0 )
            return p;
        p--;
        }
    return -1;
}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:26,代码来源:prepifelse.cpp

示例9: RemoveInvalidPathChars

wxString Utils::RemoveInvalidPathChars(wxString path, wxChar replaceWith, bool allowExclamationMark)
{
	for (size_t i = 0; i < path.Len(); i++)
	{
		if (wxFileName::GetForbiddenChars().Contains(path[i]) || !(allowExclamationMark || path[i] != '!'))
		{
			path[i] = replaceWith;
		}
	}
	return path;
}
开发者ID:Kuchikixx,项目名称:MultiMC4,代码行数:11,代码来源:apputils.cpp

示例10: SetTitle

void UiManager::SetTitle (const wxString & title)
{
    wxString newTitle;

    if (title.Len())
        newTitle << _T("FBIde - ") << title;
    else
        newTitle << _T("FBIde");

    m_frame->SetTitle (newTitle);
}
开发者ID:bihai,项目名称:fbide,代码行数:11,代码来源:uimanager.cpp

示例11: GetNextLine

wxString GOrgueConfigFileReader::GetNextLine(const wxString& buffer, unsigned &pos)
{
	int newpos = buffer.find(wxT("\n"), pos);
	if (newpos < (int)pos)
		newpos = buffer.Len();
	wxString line = buffer.Mid(pos, newpos - pos);
	pos = newpos + 1;
	if (line.Len() > 0 && line[line.Len() - 1] == wxT('\r'))
		return line.Mid(0, line.Len() - 1);
	return line;
}
开发者ID:e9925248,项目名称:grandorgue,代码行数:11,代码来源:GOrgueConfigFileReader.cpp

示例12: GetString

wxString StringFindReplacer::GetString(const wxString& input, int from, bool search_up)
{
    if (from < 0) {
        from = 0;
    }

    if ( !search_up ) {

        if (from >= (int)input.Len()) {
            return wxEmptyString;
        }
        return input.Mid((size_t)from);

    } else {
        if (from >= (int)input.Len()) {
            from = (int)input.Len();
        }
        return input.Mid(0, (size_t)from);
    }
}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例13: letters

/** Does given file contain catalogs in given language?
    Handles these cases:
      - foo/bar/lang.mo
      - foo/lang/bar.mo
      - foo/lang/LC_MESSAGES/bar.mo
    Futhermore, if \a lang is 2-letter code (e.g. "cs"), handles these:
      - foo/bar/lang_??.mo
      - foo/lang_??/bar.mo
      - foo/lang_??/LC_MESSAGES/bar.mo
    and if \a lang is five-letter code (e.g. "cs_CZ"), tries to match its
    first two letters (i.e. country-neutral variant of the language).
 */
static inline bool IsForLang(const wxString& filename, const wxString& lang,
                             bool variants = true)
{
#ifdef __WINDOWS__
    #define LC_MESSAGES_STR "/lc_messages"
#else
    #define LC_MESSAGES_STR "/LC_MESSAGES"
#endif
    wxString base, dir;
    wxSplitPath(filename, &dir, &base, NULL);
    dir.Replace(wxString(wxFILE_SEP_PATH), "/");
    return base.Matches(lang) ||
           dir.Matches("*/" + lang) ||
           dir.Matches("*/" + lang + LC_MESSAGES_STR) ||
           (variants && lang.Len() == 5 && lang[2] == _T('_') && 
                IsForLang(filename, lang.Mid(0, 2), false)) ||
           (variants && lang.Len() == 2 && 
                IsForLang(filename, lang + "_??", false));
    #undef LC_MESSAGES_STR
}
开发者ID:AdeebNqo,项目名称:poedit,代码行数:32,代码来源:transmemupd.cpp

示例14: StrToItemIntegerType

bool ecUtils::StrToItemIntegerType(const wxString & str, long &d)
{
	wxChar* pEnd;
	bool rc;
	errno=0;
	bool bHex=(str.Len() > 2 && str[0]==wxT('0') && (str[1]==wxT('x')||str[1]==wxT('X')));
	//d=_tcstol(str,&pEnd,bHex?16:10);
	d=wxStrtol(str,&pEnd,bHex?16:10);
	rc=(0==errno && (*pEnd==wxT('\0')));
	return rc;
}
开发者ID:Joel397,项目名称:Ongoing_work_files,代码行数:11,代码来源:ecutils.cpp

示例15: add

INLINE 
void wxeReturn::add(const wxString s) {
    int strLen = s.Len();
    wxCharBuffer resultCB = s.mb_str(utfConverter);
    int * resultPtr = (int *) resultCB.data();

    for (int i = 0; i < strLen; i++, resultPtr++) {
        addInt(*resultPtr);
    }
    endList(strLen);       
}
开发者ID:AlainODea,项目名称:otp,代码行数:11,代码来源:wxe_return.cpp


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