本文整理汇总了C++中ModelHistory::resetModifiedFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelHistory::resetModifiedFlags方法的具体用法?C++ ModelHistory::resetModifiedFlags怎么用?C++ ModelHistory::resetModifiedFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelHistory
的用法示例。
在下文中一共展示了ModelHistory::resetModifiedFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModelHistory
ModelHistory*
RDFAnnotationParser::deriveHistoryFromAnnotation(
const XMLNode * annotation)
{
ModelHistory * history = NULL;
if (annotation == NULL)
return history;
// the annotation passed in may have a toplevel annotation tag BUT
// it may not be- so need to check
// if it isnt then it must be RDF or we do not have an rdf annotation
bool topLevelIsAnnotation = false;
if (annotation->getName() == "annotation")
{
topLevelIsAnnotation = true;
}
const XMLNode* RDFDesc = NULL;
if (topLevelIsAnnotation == true)
{
RDFDesc = &(annotation->getChild("RDF").getChild("Description"));
}
else
{
if (annotation->getName() == "RDF")
{
RDFDesc = &(annotation->getChild("Description"));
}
}
ModelCreator* creator = NULL;
Date * modified = NULL;
Date * created = NULL;
static const XMLNode outOfRange;
// find creation nodes and create history
if (RDFDesc != NULL)
{
history = new ModelHistory();
const XMLNode *creatorNode = &(RDFDesc->getChild("creator").getChild("Bag"));
if (creatorNode->equals(outOfRange) == false)
{
for (unsigned int c = 0; c < creatorNode->getNumChildren(); c++)
{
creator = new ModelCreator(creatorNode->getChild(c));
history->addCreator(creator);
delete creator;
}
}
const XMLNode *createdNode = &(RDFDesc->getChild("created").getChild("W3CDTF"));
if (createdNode->equals(outOfRange) == false)
{
if (createdNode->getChild(0).isText() == true)
{
created = new Date(createdNode->getChild(0).getCharacters());
history->setCreatedDate(created);
delete created;
}
}
/* there are possibly more than one modified elements */
for (unsigned int n = 0; n < RDFDesc->getNumChildren(); n++)
{
if (RDFDesc->getChild(n).getName() == "modified")
{
const XMLNode *modifiedNode = &(RDFDesc->getChild(n).getChild("W3CDTF"));
if (modifiedNode->equals(outOfRange) == false)
{
if (modifiedNode->getChild(0).isText() == true)
{
modified = new Date(modifiedNode->getChild(0).getCharacters());
history->addModifiedDate(modified);
delete modified;
}
}
}
}
history->resetModifiedFlags();
}
return history;
}