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


C++ Section类代码示例

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


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

示例1: section_group

bool SectionHDF5::deleteSection(const string &name_or_id) {
    boost::optional<H5Group> g = section_group();
    bool deleted = false;

    if (g) {
        // call deleteSection on sections to trigger recursive call to all sub-sections
        if (hasSection(name_or_id)) {
            // get instance of section about to get deleted
            Section section = getSection(name_or_id);
            // loop through all child sections and call deleteSection on them
            for (auto &child : section.sections()) {
                section.deleteSection(child.id());
            }
            // if hasSection is true then section_group always exists
            deleted = g->removeAllLinks(section.name());
        }
    }

    return deleted;
}
开发者ID:cgars,项目名称:nix,代码行数:20,代码来源:SectionHDF5.cpp

示例2: if

SectionSP
SectionList::FindSectionContainingLinkedFileAddress (addr_t vm_addr, uint32_t depth) const
{
    SectionSP sect_sp;
    const_iterator sect_iter;
    const_iterator end = m_sections.end();
    for (sect_iter = m_sections.begin(); sect_iter != end && sect_sp.get() == NULL; ++sect_iter)
    {
        Section *sect = sect_iter->get();
        if (sect->ContainsLinkedFileAddress (vm_addr))
        {
            sect_sp = *sect_iter;
        }
        else if (depth > 0)
        {
            sect_sp = sect->GetChildren().FindSectionContainingLinkedFileAddress (vm_addr, depth - 1);
        }
    }
    return sect_sp;
}
开发者ID:eightcien,项目名称:lldb,代码行数:20,代码来源:Section.cpp

示例3: mem_conf

void mem_conf(std::string memtype, int option) {
	std::string tmp;
	Section* sec = control->GetSection("dos");
	Section_prop * section=static_cast<Section_prop *>(sec); 
	if (!option) {
		tmp = section->Get_bool(memtype) ? "false" : "true";
	} else {
		switch (option) {
			case 1: tmp = "true"; break;
			case 2: tmp = "false"; break;
			case 3: tmp = "emsboard"; break;
			case 4: tmp = "emm386"; break;
			default: return;
		}
	}
	if(sec) {
		memtype += "=" + tmp;
		sec->HandleInputline(memtype);
	}
}
开发者ID:joncampbell123,项目名称:dosbox-rewrite,代码行数:20,代码来源:menu.cpp

示例4: GetSection

/////////////////////////////////
// Create anti-action for insert
Action ActionModify::GetAntiAction() const
{
	// Get section and original line
	Section sect = GetSection(section);
	Entry oldEntry = sect->GetEntry(lineNumber);

	// Try to get a delta
	DeltaCoder deltaCoder = oldEntry->GetDeltaCoder();
	if (deltaCoder) {
		VoidPtr _delta;
		if (entry) _delta = deltaCoder->EncodeDelta(entry,oldEntry,!noTextFields);
		else _delta = deltaCoder->EncodeReverseDelta(delta,oldEntry);
		return Action(new ActionModify(GetModel(),_delta,lineNumber,section));
	}

	// Store the whole original line
	else {
		return Action(new ActionModify(GetModel(),oldEntry,lineNumber,section,noTextFields));
	}
}
开发者ID:Aegisub,项目名称:Athenasub,代码行数:22,代码来源:action.cpp

示例5: Assert

		IniFile* IniFile::ReadIniFile(CStr fileName)
		{
			Assert(fileName);
			CStr braceOpen = Text("[");
			//CStr braceClose = Text("]");
			CStr equal = Text("=");
			IniFile* iniFile;
			String::StrPtrVec* lines;
			String::StrPtrVec::Element* it;
			Section section;
			Int index;
			KeyValue keyValue;

			iniFile = new IniFile();
			lines = TextFile::ReadLines(fileName);

			for(it = lines->Begin(); it < lines->End(); ++it)
			{
				String& line = **it;
				if(line.TrimLeft().StartsWith(braceOpen))
				{
					if(!section.IsEmpty())
					{
						iniFile->SectionList.Add(section);
						section.Clear();
					}
					section.Name = line;
				}
				else if((index = line.IndexOf(equal)) != -1)
				{
					if(!section.Name.IsEmpty())
					{
						keyValue.Key = line.SubString(0U, index - 2).Trim();
						keyValue.Value = line.SubString(index - 1, line.Length() - index - 1).Trim();
						section.KeyValueList.Add(keyValue);
					}
				}
			}

			return iniFile;
		}
开发者ID:Karkasos,项目名称:Core,代码行数:41,代码来源:IniFile.cpp

示例6: visit_Section

 bool visit_Section(Section & s)
 {
     str_type base_dir = this->_base_dir;
     if(s.has_key("__base_dir__"))
     {
         str_type section_base_dir = s.at("__base_dir__");
         if(section_base_dir.size() > 0)
         {
             base_dir = section_base_dir;
         }
     }
     str_type norm_base_dir = this->_normpath(base_dir);
     //std::cout << "s<" << s << "> " << base_dir << " : " << this->_base_dir << std::endl;
     if(base_dir.size() > 0 && norm_base_dir != this->_base_dir)
     {
         ResetBaseDirVisitor reset_base_dir_visitor(base_dir, this->_reset);
         s.accept(reset_base_dir_visitor);
         return false;
     }
     return true;
 }
开发者ID:simone-campagna,项目名称:Configment,代码行数:21,代码来源:section.cpp

示例7: while

void
ConfigDocumentXML::parse()
{
  QDomNode n = document_.firstChild();
  if (!n.isNull()) {
    QDomNode n1 = n.firstChild();
    QListViewItem * pre = NULL;
    while (!n1.isNull()) {
      QDomElement e = n1.toElement();
      if (!e.isNull() &&
	  e.tagName() == Section::XML_TAG) {
	Section * section =
	  new Section(e, 
		      listViewItem(), pre, 
		      this, e.attribute("name"));
	pre = section->listViewItem();
      }
      n1 = n1.nextSibling();
    }
  }
}
开发者ID:BackupTheBerlios,项目名称:miro-middleware-svn,代码行数:21,代码来源:ConfigDocumentXML.cpp

示例8: addGnuDebugLink

static void addGnuDebugLink(Object &Obj, StringRef DebugLinkFile) {
  uint32_t StartRVA = getNextRVA(Obj);

  std::vector<Section> Sections;
  Section Sec;
  Sec.setOwnedContents(createGnuDebugLinkSectionContents(DebugLinkFile));
  Sec.Name = ".gnu_debuglink";
  Sec.Header.VirtualSize = Sec.getContents().size();
  Sec.Header.VirtualAddress = StartRVA;
  Sec.Header.SizeOfRawData = alignTo(Sec.Header.VirtualSize,
                                     Obj.IsPE ? Obj.PeHeader.FileAlignment : 1);
  // Sec.Header.PointerToRawData is filled in by the writer.
  Sec.Header.PointerToRelocations = 0;
  Sec.Header.PointerToLinenumbers = 0;
  // Sec.Header.NumberOfRelocations is filled in by the writer.
  Sec.Header.NumberOfLinenumbers = 0;
  Sec.Header.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA |
                               IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_DISCARDABLE;
  Sections.push_back(Sec);
  Obj.addSections(Sections);
}
开发者ID:jamboree,项目名称:llvm,代码行数:21,代码来源:COFFObjcopy.cpp

示例9: assert

void ConfigFile::setKey(const String &key, const String &section, const String &value) {
	assert(isValidName(key));
	assert(isValidName(section));
	// TODO: Verify that value is valid, too. In particular, it shouldn't
	// contain CR or LF...

	Section *s = getSection(section);
	if (!s) {
		KeyValue newKV;
		newKV.key = key;
		newKV.value = value;

		Section newSection;
		newSection.name = section;
		newSection.keys.push_back(newKV);

		_sections.push_back(newSection);
	} else {
		s->setKey(key, value);
	}
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:21,代码来源:config-file.cpp

示例10: printPath

 void printPath() const {
     int len = (int)size();
     int pe = -1;
     for(int i=0;i<len;++i) {
         Section* s = at(i);
         int se = positions[i];
         if(pe == -1) {
             pe = se;
         }
         if(se == pe) {
             s->print('|', se);
         }
         else if(se < pe) {
             s->print('/', se);
         }
         else {
             s->print('\\', se);
         }
         pe = se;
     }
 }
开发者ID:teju85,项目名称:programming,代码行数:21,代码来源:RacingChars.cpp

示例11: Section

Section* Section::createSection(SectionInfo* sectionInfo,int index,int type,int p_index,int s_index){
    Section *item = new Section();
    if(item && item->init()){
    
        PlayConfig* playConfig = (PlayConfig*)poptGlobal->gni->getConfig();
        
        //音乐信息
        MusicModel* musicModel = playConfig->musicModel;
        //小节拍数
        int beatFlag = musicModel->getBeatFlag();
        //单元宽度,拍与拍之间的距离
        float unitWidth = playConfig->unitWidth;
        //小节总宽度
        item->sectionWidth = unitWidth*beatFlag;
        float sectionX = item->sectionWidth*(float)(index-1);
        item->p_index = p_index;
        item->s_index = s_index;
        
        item->sectionIndex = index;
        item->type = type;
        item->playConfig = playConfig;
        item->setAnchorPoint(Vec2::ZERO);
        item->setPosition(Vec2(sectionX,0));
        item->loadMusical(sectionInfo);
        item->autorelease();
        
        return item;
    }
    CC_SAFE_DELETE(item);
    return nullptr;
}
开发者ID:ruoqi,项目名称:poputar,代码行数:31,代码来源:Section.cpp

示例12:

std::shared_ptr <NodeStore::Backend>
SHAMapStoreImp::makeBackendRotating (std::string path)
{
    boost::filesystem::path newPath;
    Section parameters = setup_.nodeDatabase;

    if (path.size())
    {
        newPath = path;
    }
    else
    {
        boost::filesystem::path p = get<std::string>(parameters, "path");
        p /= dbPrefix_;
        p += ".%%%%";
        newPath = boost::filesystem::unique_path (p);
    }
    parameters.set("path", newPath.string());

    return NodeStore::Manager::instance().make_Backend (parameters, scheduler_,
            nodeStoreJournal_);
}
开发者ID:onedot618,项目名称:rippled,代码行数:22,代码来源:SHAMapStoreImp.cpp

示例13:

void
SectionList::BuildRangeCache() const
{
    m_range_cache.Clear();
    
    for (collection::size_type idx = 0, last_idx = m_sections.size();
         idx < last_idx;
         ++idx)
    {
        Section *sect = m_sections[idx].get();
        
        addr_t linked_file_address = sect->GetLinkedFileAddress();
        
        if (linked_file_address != LLDB_INVALID_ADDRESS)
            m_range_cache.Append(SectionRangeCache::Entry(linked_file_address, sect->GetByteSize(), idx));
    }
    
    m_range_cache.Sort();
    
#ifdef LLDB_CONFIGURATION_DEBUG
    m_finalized = true;
#endif
}
开发者ID:carlokok,项目名称:lldb,代码行数:23,代码来源:Section.cpp

示例14: RemoveSection

// administrator removes a section
bool Administrator::RemoveSection(const Section &s) const
{
    /*delete a record from the section table*/

    QString str;
    str = "delete from Section where courseID = ";
    str += QString::number(s.GetCourseID());
    str += " and secID = ";
    str += QString::number(s.GetSecID());
    str += " and semester = '";
    str += s.GetSemester().data();
    str += "' and year = ";
    str += QString::number(s.GetYear());
    str += " and building = '";
    str += s.GetBuilding().data();
    str += "'";

    QSqlQuery query;
    if(!query.exec(str))
       return false;

    return true;
}
开发者ID:buguake,项目名称:cms,代码行数:24,代码来源:administrator.cpp

示例15:

std::vector<std::vector<Section*>> MysteryDungeonMaker::ClassifyGroups()
{
	std::vector<std::vector<Section*>> groups;
	int groupId = 0;

	int mapHeight=dungeonSize->DungeonRowNum();
	int sectionColumnNum = dungeonSize->DungeonColumnNum();
	for (int i = 0; i < mapHeight; i++)
	{
		for (int j = 0; j < sectionColumnNum; j++)
		{
			Section* current = &sections[i][j];
			if (current->HasRoom())
			{
				if (groups.empty())
				{
					groups.push_back(current->SetGroupId(groupId++));
				}
				else
				{
					int  notMarked = 0;
					for (size_t i_groups = 0; i_groups < groups.size(); i_groups++)
					{
						if (!DungeonMakerHelper::HasComponent(groups[i_groups], current->GetComponent()))
						{
							notMarked++;
						}
					}
					if (notMarked == groups.size())
						groups.push_back(current->SetGroupId(groupId++));
				}
			}
		}
	}

	return groups;
}
开发者ID:kyorop,项目名称:KwsRogueLike,代码行数:37,代码来源:MysteryDungeonMaker.cpp


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