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


C++ wstring::find方法代码示例

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


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

示例1: urlSuitableForTestResult

wstring urlSuitableForTestResult(const wstring& url)
{
    if (!url.c_str() || url.find(L"file://") == wstring::npos)
        return url;

    return PathFindFileNameW(url.c_str());
}
开发者ID:dzip,项目名称:webkit,代码行数:7,代码来源:DumpRenderTree.cpp

示例2: bindBuiltinVariable

/***************************************************************************
 *      bindBuiltinVariable
 ***************************************************************************/
bool CCilVm::bindBuiltinVariable( const wstring& strQualifiedName,
                                  CVariable* const pvar )
{
    bool bReturn = true;

    //Bind the var

    if( strQualifiedName.find( STRING_INTERNAL_SCOPEDELIMITER ) != wstring::npos )
    {
        wstring strRoot = strQualifiedName.substr( 0, strQualifiedName.rfind( STRING_INTERNAL_SCOPEDELIMITER ) );
        assert( strRoot.find( STRING_INTERNAL_SCOPEDELIMITER ) == wstring::npos );

        wstring strLeaf = strQualifiedName.substr( strQualifiedName.rfind( STRING_INTERNAL_SCOPEDELIMITER ) + 1,
                          strQualifiedName.length() );
        RID ridObject = getMetaData().queryBuiltinObjectRid( strRoot );
        if( ridObject == RID_NOTDEFINED )
            return false;

        //Create property
        getPrototypeObject( ridObject ).setProperty( strLeaf,
                *pvar );
    }

    return bReturn;
}
开发者ID:hak,项目名称:criscript,代码行数:28,代码来源:cilVMBind.cpp

示例3: fillExplicitTableHeadersForCell

/*
 * Adds table header info for a single cell which explicitly defines headers
 * using the Headers attribute.
 */
inline void fillExplicitTableHeadersForCell(AdobeAcrobatVBufStorage_controlFieldNode_t& cell, int docHandle, wstring& headersAttr, TableInfo& tableInfo) {
	wostringstream colHeaders, rowHeaders;

	// The Headers attribute string is in the form "[[id id ... ]]"
	// Loop through all the ids.
	// Ignore the "[[" prefix and the " ]]" suffix.
	size_t lastPos = headersAttr.length() - 3;
	size_t startPos = 2;
	while (startPos < lastPos) {
		// Search for a space, which indicates the end of this id.
		size_t endPos = headersAttr.find(L' ', startPos);
		if (endPos == wstring::npos)
			break;
		// headersAttr[startPos:endPos] is the id of a single header.
		// Find the info for the header associated with this id string.
		map<wstring, TableHeaderInfo>::const_iterator it = tableInfo.headersInfo.find(headersAttr.substr(startPos, endPos - startPos));
		startPos = endPos + 1;
		if (it == tableInfo.headersInfo.end())
			continue;

		if (it->second.type & TABLEHEADER_COLUMN)
			colHeaders << docHandle << L"," << it->second.uniqueId << L";";
		if (it->second.type & TABLEHEADER_ROW)
			rowHeaders<< docHandle << L"," << it->second.uniqueId << L";";
	}

	if (colHeaders.tellp() > 0)
		cell.addAttribute(L"table-columnheadercells", colHeaders.str());
	if (rowHeaders.tellp() > 0)
		cell.addAttribute(L"table-rowheadercells", rowHeaders.str());
}
开发者ID:KarishmaChanglani,项目名称:nvda,代码行数:35,代码来源:adobeAcrobat.cpp

示例4: parse

int WinContactSIF::parse(const wstring & data) {

    if (!sifFields) {
        LOG.error("%s", ERR_SIFFIELDS_NULL);
        return 1;
    }
    propertyMap.clear();

    // Check if <contact> tag is present...
    wstring::size_type pos = 0;
    wstring itemTypeTag = L"<contact>";    
    pos = data.find(itemTypeTag, 0);
    if (pos == wstring::npos) {
        LOG.error("Tag '%ls' not found", itemTypeTag.c_str());
        return 1;
    }
    wstring propertyValue;
       
    for (int i=0; sifFields[i]; i++) {
        // Set only properties found!
        if (!getElementContent(data, sifFields[i], propertyValue, 0)) {

            replaceAll(L"&lt;",  L"<", propertyValue);
            replaceAll(L"&gt;",  L">", propertyValue);
            replaceAll(L"&amp;", L"&", propertyValue);
            
            setProperty(sifFields[i], propertyValue);
        }
    }   
    return 0;
}
开发者ID:niujingqian,项目名称:haocai,代码行数:31,代码来源:WinContactSIF.cpp

示例5: IsURL

bool IsURL(wstring const &str)
{
	if(str.find(TEXT(" "), 0) != wstring::npos)
	{
		return false;
	}

	wstring upr(UpperCase(str));

	if(upr.compare(0, 7, TEXT("HTTP://")) == 0 || upr.compare(0, 8, TEXT("HTTPS://")) == 0)
	{
		return true;
	}

	WCHAR **tld = gTopLevelDomains;
	while(*tld != nullptr)
	{
		if(upr.find(*tld, 0) != wstring::npos)
		{
			return true;
		}
		++tld;
	}
	return false;
}
开发者ID:MOURAD24,项目名称:SearchClip,代码行数:25,代码来源:Util.cpp

示例6: setCurrentFile

bool FileList::setCurrentFile(const wstring &current_file)
{
    wstring base_path = FilePath::cleanUpPath(_baseDirectory.getPath()) + L"\\";;
    if (current_file.find(base_path) != 0) {
        return false;
    }

    if (base_path.length() == current_file.length()) {
        return false;
    }

    vector<wstring> split_path;
    FilePath::splitFilePath(current_file.substr(base_path.length()), split_path);

    wstring current_path = base_path;
    for (vector<wstring>::iterator i = split_path.begin(); i != split_path.end(); ++i) {
        wstring name = *i;
        current_path += name + L"\\";

        FileInfo fileInfo(current_path);
        if (fileInfo.isDirectory()) {
            Directory *next_directory = new Directory(current_path);
            _directories.top()->setCurrentSubDirectory(name);
            _directories.push(next_directory);
        }
        else if (fileInfo.isFile()) {
            return _directories.top()->setCurrentFile(name);
        }
        else {
            return false;
        }
    }
    return false;
}
开发者ID:watsonmw,项目名称:platform,代码行数:34,代码来源:filelist.cpp

示例7: interpolate

wstring QueryAssembler::interpolate(const wstring& rule, const shared_ptr<IMatch>& match, const NetEvaluator& evaluator)
{
	unordered_map<wstring, wstring> evaluation = evaluator.Evaluate(match, currentFrameTense); //evaluator calculates all values which could be interpolated into the template

	wstring filler;
	
	wstring toReturn = rule;

	size_t c_pos = 0;
	size_t pos = 0;

	while((pos = rule.find(L"${", c_pos)) != wstring::npos) //replace all placeholders in the template with calculated values
	{
		size_t pos2 = rule.find(L"}", pos);
		if(pos2 == wstring::npos)
		{
			throw EInvalidSlotRule(match->GetNetName().c_str());
		}

		wstring placeHolder = rule.substr(pos + 2, pos2 - pos - 2);

		size_t point_pos;

		if((point_pos = placeHolder.find(L".")) != wstring::npos) //reference to subfield ".field" is supported
		{
			wstring field = placeHolder.substr(point_pos + 1);
			if(evaluation.find(field) == evaluation.end())
			{
				throw ENoExistingFieldReference(match->GetNetName().c_str());
			}
			filler = evaluation.at(field);
		}
		else
		{
			filler = evaluation.at(NetEvaluator::VALUE); //if no field is referenced field .VALUE is referenced by default
		}

		c_pos = pos2;

		size_t repl1 = toReturn.find(L"${");
		size_t repl2 = toReturn.find(L"}") + 1;

		toReturn.replace(repl1, repl2 - repl1, filler);
	}

	return toReturn;
}
开发者ID:Samsung,项目名称:veles.nlp,代码行数:47,代码来源:QueryAssembler.cpp

示例8: ChgText

void CParseSearchChgText::ChgText(wstring& chgText)
{
	for( size_t i = 0; i<this->chgKey.size(); i++ ){
		if( chgText.find( this->chgKey[i].oldText ) != string::npos ){
			Replace(chgText, this->chgKey[i].oldText, this->chgKey[i].newText);
		}
	}
}
开发者ID:ACUVE,项目名称:EDCB,代码行数:8,代码来源:ParseSearchChgText.cpp

示例9: substr_after

wstring substr_after(const wstring& s, const wstring& skip) {
	size_t p = s.find(skip);
	if (p == wstring::npos) {
		return NULL;
	}
	
	return s.substr(skip.length() + p);
}
开发者ID:kevx,项目名称:sdkfz000,代码行数:8,代码来源:utils.cpp

示例10:

wstring 
Utils::get_tag_value(wstring tags, wstring values) {
  vector<wstring> pval=StringUtils::split_wstring(values,L"|");

  for(wstring::size_type i=0; i<pval.size(); i++) {
    if (tags.find(pval[i]) != wstring::npos)
    {
		int pos=tags.find(pval[i]);
		if( (pos==0 || tags[pos-1]==L'.') && (pos==tags.size()-1 || tags[pos+1]==L'.'))
			return pval[i];
		else
			return L"";
    }
  }

  return L"";
}
开发者ID:sundetova,项目名称:kaz-eng-generalisation,代码行数:17,代码来源:Utils.C

示例11: getAbsolutePath

			// 根据相对路径获取绝对路径
			// 如果relativePath已经是绝对路径,则直接返回
			// 否则将返回appPath+relativePath
			wstring getAbsolutePath(wstring &relativePath, wstring &appPath){
				if (relativePath.find(L":") == -1){// 如果指定的路径是相对路径
					wstring _path(appPath);
					_path.append(relativePath);
					return _path;
				}
				return relativePath;
			}
开发者ID:penbor,项目名称:jwebtop,代码行数:11,代码来源:OS.cpp

示例12: StatusCodeAnalysis

bool Inet::StatusCodeAnalysis(wstring sctext,int* res){
	int i,n,pos;
	wchar_t *err;
	if(pos=sctext.find(' ')==wstring::npos){
		return false;
	}
	sctext.erase(0,pos+1);
	if(pos=sctext.find(' ')==wstring::npos){
		return false;
	}
	sctext.erase(pos);
	*res=wcstol(sctext.c_str(),&err,10);
	if(lstrlen(err)!=0){
		return false;
	}
	return true;
}
开发者ID:tiku,项目名称:test,代码行数:17,代码来源:SOCKET.cpp

示例13: GetString

bool CRealTextParser::GetString(wstring& p_rszLine, unsigned int& p_riPos, wstring& p_rszString, const wstring& p_crszEndChars)
{
    while (p_rszLine.length() > p_riPos && p_crszEndChars.find(p_rszLine.at(p_riPos)) == wstring::npos) {
        p_rszString += p_rszLine.at(p_riPos);
        ++p_riPos;
    }

    return p_rszLine.length() > p_riPos;
}
开发者ID:AeonAxan,项目名称:mpc-hc,代码行数:9,代码来源:RealTextParser.cpp

示例14: doReplace

wstring NBTools::doReplace(wstring text, wstring find, wstring replace)
{
    while (true)
    {
        size_t pos = text.find(find);
        if (0 > pos || pos > text.length()) return text;
        text = text.replace(pos, find.length(), replace);
    }
}
开发者ID:JohnBFrm,项目名称:NohBoard,代码行数:9,代码来源:nbtools.cpp

示例15: move

	template<> void WXML::constructKey(wstring &str)
	{
		long startX = str.find('<') + 1;
		long endX =
			Math::calcMin<long>
			(
		{
			indexFilter(str.find(' ', startX)),
			indexFilter(str.find('\n', startX)),
			indexFilter(str.find('\t', startX)),
			indexFilter(str.find('>', startX)),
			indexFilter(str.find('/', startX))
		}
		).getValue();

		//Determinate the KEY
		key = move(WStringUtil::substring(str, startX, endX));
	}
开发者ID:leedabin,项目名称:framework,代码行数:18,代码来源:WXML.cpp


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