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


C++ Name::isAbsolute方法代码示例

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


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

示例1:

	Name::Name(const Name& name, size_t substrSize)
	: isAbsolute_(name.isAbsolute()) {
		assert(substrSize <= name.size());
		list_.reserve(substrSize);
		for(std::size_t i = 0; i < substrSize; i++){
			list_.push_back(name.at(i));
		}
	}
开发者ID:PuerkitoBio,项目名称:locic,代码行数:8,代码来源:Name.cpp

示例2: makeAbsolute

	Name Name::makeAbsolute(const Name& name) const{
		assert(isAbsolute());
		assert(!name.empty());
		if(name.isAbsolute()) {
			return name.copy();
		} else {
			return concat(name);
		}
	}
开发者ID:PuerkitoBio,项目名称:locic,代码行数:9,代码来源:Name.cpp

示例3: performInnerAliasSearch

		SearchResult performInnerAliasSearch(AST::Alias& alias, const Name& name) {
			if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
			
			const auto iterator = alias.namedTemplateVariables().find(name.at(0));
			if (iterator != alias.namedTemplateVariables().end()) {
				return SearchResult::TemplateVar(*(iterator->second));
			}
			
			return SearchResult::None();
		}
开发者ID:scrossuk,项目名称:locic,代码行数:10,代码来源:NameSearch.cpp

示例4: performInnerCatchClauseSearch

		SearchResult performInnerCatchClauseSearch(AST::CatchClause* catchClause, const Name& name) {
			if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
			
			const auto iterator = catchClause->namedVariables().find(name.at(0));
			if (iterator != catchClause->namedVariables().end()) {
				return SearchResult::Var(*(iterator->second));
			}
			
			return SearchResult::None();
		}
开发者ID:scrossuk,项目名称:locic,代码行数:10,代码来源:NameSearch.cpp

示例5: performInnerTypeInstanceSearch

		SearchResult performInnerTypeInstanceSearch(AST::TypeInstance& typeInstance, const Name& name) {
			if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
			
			const auto iterator = typeInstance.namedTemplateVariables().find(name.at(0));
			if (iterator != typeInstance.namedTemplateVariables().end()) {
				return SearchResult::TemplateVar(*(iterator->second));
			}
			
			return SearchResult::None();
		}
开发者ID:scrossuk,项目名称:locic,代码行数:10,代码来源:NameSearch.cpp

示例6: performSearch

		SearchResult performSearch(Context& context, const Name& name, const size_t searchStartPosition) {
			assert(!name.empty());
			
			const auto& scopeStack = context.scopeStack();
			
			const size_t startPosition = name.isAbsolute() ? scopeStack.size() - 1 : searchStartPosition;
			for (size_t i = startPosition; i < scopeStack.size(); i++) {
				const auto pos = scopeStack.size() - i - 1;
				const auto result = performInnerSearch(scopeStack[pos], name);
				if (!result.isNone()) return result;
			}
			
			return SearchResult::None();
		}
开发者ID:scrossuk,项目名称:locic,代码行数:14,代码来源:NameSearch.cpp

示例7: performInnerFunctionSearch

		SearchResult performInnerFunctionSearch(AST::Function& function, const Name& name) {
			if (name.size() != 1 || name.isAbsolute()) return SearchResult::None();
			
			// Search template variables.
			{
				const auto iterator = function.namedTemplateVariables().find(name.at(0));
				if (iterator != function.namedTemplateVariables().end()) {
					return SearchResult::TemplateVar(*(iterator->second));
				}
			}
			
			// Search parameter variables.
			{
				const auto iterator = function.namedVariables().find(name.at(0));
				if (iterator != function.namedVariables().end()) {
					return SearchResult::Var(*(iterator->second));
				}
			}
			
			return SearchResult::None();
		}
开发者ID:scrossuk,项目名称:locic,代码行数:21,代码来源:NameSearch.cpp


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