本文整理汇总了C++中ItemList::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemList::addChild方法的具体用法?C++ ItemList::addChild怎么用?C++ ItemList::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemList
的用法示例。
在下文中一共展示了ItemList::addChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PersName
void CScribeToNeoScribeXML::Scribe2MEIXMLFileData(FileDesc* fileDesc, const scribe_part& partit )
{
//title element and dependencies - part of fileDesc area of mei header
//at this point of time, title and creator elements reside in the header and must be filled in the part iteration.
//titleStmt
TitleStmt* titleSmt = new TitleStmt;
fileDesc->addChild(titleSmt);
Title* title = new Title; //will fill below in clunky fashion
title->setValue(partit.title);
titleSmt->addChild(title);
RespStmt* respStmt = new RespStmt;
titleSmt->addChild(respStmt);
PersName* creator = new PersName;
creator->addAttribute("role", "creator");
creator->setValue(partit.composer);
respStmt->addChild(creator);
PersName* encoder_pers = new PersName();
encoder_pers->addAttribute("role", "encoder");
encoder_pers->setValue(encoder);
respStmt->addChild(encoder_pers);
//fileDesc - <sourceDesc> - part of fileDesc area of mei header
//ultimately source Desc must be linked to the music division element to permit multiple sources in the one file. Currently they reside in the header. New handing needed that is more multisource oriented
SourceDesc* sourceDesc = new SourceDesc;
fileDesc->addChild(sourceDesc);
Source* source = new Source;
source->addAttribute("n", partit.abbrev_ms);
source->addAttribute("label", "manuscript");
sourceDesc->addChild(source);
TitleStmt* sourceTitleSmt = new TitleStmt;
Title* sourceTitle = new Title; //will fill below in clunky fashion
sourceTitle->setValue(partit.title);
sourceTitleSmt->addChild(sourceTitle);
source->addChild(sourceTitleSmt);
ItemList* itemlist = new ItemList;
source->addChild(itemlist);
Item* msitem = new Item;
itemlist->addChild(msitem);
msitem->addAttribute("type", "manuscript");
if (sourcekey->contains_code(partit.abbrev_ms))
{
std::string fols = ", fol. ";
if (partit.folios.find('-')!=std::string::npos || partit.folios.find("/n-dash")!=std::string::npos ) {
fols = ", fols. ";
}
msitem->setValue(sourcekey->getSourceName(partit.abbrev_ms)+ fols + partit.folios);
}
RespStmt* sourceRespStmt = new RespStmt;
//Composer
PersName* composer = new PersName;
composer->addAttribute("role", "composer"); //also add other attributes like dbkey, url
composer->setValue(partit.composer);
sourceRespStmt->addChild(composer);
//For later population
PersName* poet = new PersName;
poet->addAttribute("role", "poet");
poet->setValue("TBC");
sourceRespStmt->addChild(poet);
//for later population
PersName* dedicatee = new PersName;
dedicatee->addAttribute("role", "dedicatee");
dedicatee->setValue("TBC");
sourceRespStmt->addChild(dedicatee);
source->addChild(sourceRespStmt);
PhysLoc* physLoc = new PhysLoc;
if (sourcekey->contains_code(partit.abbrev_ms))
{
Repository* ms = new Repository;
physLoc->addChild(ms);
Abbr* abbr = new Abbr;
abbr->addAttribute("label", "RISM siglum");
ms->addChild(abbr);
Expan* expan = new Expan;
expan->addAttribute("label", "library");
ms->addChild(expan);
abbr->setValue(sourcekey->getRISMName(partit.abbrev_ms));
expan->setValue(sourcekey->getSourceName(partit.abbrev_ms));
}
source->addChild(physLoc); //place for placing city, archive, shelfnumber
/* - Revision Description
</meihead>
*/
}