FieldDecl *Sema::ActOnDerivedTypeFieldDecl(ASTContext &C, DeclSpec &DS, SourceLocation IDLoc, const IdentifierInfo *IDInfo, ExprResult Init) { QualType T = ActOnTypeName(C, DS); if(auto ArrTy = T->asArrayType()) { // FIXME: check deferred shape when pointer is used. for(auto Dim : ArrTy->getDimensions()) { if(!isa<ExplicitShapeSpec>(Dim)) { Diags.Report(IDLoc, diag::err_invalid_type_field_array_shape); break; } } } else if(auto RecordTy = T->asRecordType()) { if(cast<RecordDecl>(CurContext)->isSequence()) { auto Record = RecordTy->getElement(0)->getParent(); if(!Record->isSequence()) { Diags.Report(IDLoc, diag::err_record_member_not_sequence) << IDInfo << T; } } } FieldDecl* Field = FieldDecl::Create(C, CurContext, IDLoc, IDInfo, T); if (auto Prev = LookupIdentifier(IDInfo)) { Diags.Report(IDLoc, diag::err_duplicate_member) << IDInfo; Diags.Report(Prev->getLocation(), diag::note_previous_declaration); } else CurContext->addDecl(Field); return Field; }
const QString FilePattern::path() const { if (!isSequence()) return m_pattern; else return QString(); }
const QString FilePattern::path(int frame) const { if (isSequence()) { QString path; path.sprintf(m_pattern.toLatin1(), frame); return path; } else { return QString(); } }
bool Chaser::loadXML(const QDomElement& root) { if (root.tagName() != KXMLQLCFunction) { qWarning() << Q_FUNC_INFO << "Function node not found"; return false; } if (root.attribute(KXMLQLCFunctionType) != typeToString(Function::Chaser)) { qWarning() << Q_FUNC_INFO << root.attribute(KXMLQLCFunctionType) << "is not a chaser"; return false; } /* Load chaser contents */ QDomNode node = root.firstChild(); while (node.isNull() == false) { QDomElement tag = node.toElement(); if (tag.tagName() == KXMLQLCBus) { m_legacyHoldBus = tag.text().toUInt(); } else if (tag.tagName() == KXMLQLCFunctionSpeed) { loadXMLSpeed(tag); } else if (tag.tagName() == KXMLQLCFunctionDirection) { loadXMLDirection(tag); } else if (tag.tagName() == KXMLQLCFunctionRunOrder) { loadXMLRunOrder(tag); } else if (tag.tagName() == KXMLQLCChaserSpeedModes) { QString str; str = tag.attribute(KXMLQLCFunctionSpeedFadeIn); setFadeInMode(stringToSpeedMode(str)); str = tag.attribute(KXMLQLCFunctionSpeedFadeOut); setFadeOutMode(stringToSpeedMode(str)); str = tag.attribute(KXMLQLCFunctionSpeedDuration); setDurationMode(stringToSpeedMode(str)); } else if (tag.tagName() == KXMLQLCChaserSequenceTag) { QString str = tag.attribute(KXMLQLCChaserSequenceBoundScene); enableSequenceMode(str.toUInt()); if (tag.hasAttribute(KXMLQLCChaserSequenceStartTime)) setStartTime(tag.attribute(KXMLQLCChaserSequenceStartTime).toUInt()); if (tag.hasAttribute(KXMLQLCChaserSequenceColor)) setColor(QColor(tag.attribute(KXMLQLCChaserSequenceColor))); if (tag.hasAttribute(KXMLQLCChaserSequenceLocked)) setLocked(true); } else if (tag.tagName() == KXMLQLCFunctionStep) { //! @todo stepNumber is useless if the steps are in the wrong order ChaserStep step; int stepNumber = -1; if (step.loadXML(tag, stepNumber) == true) { if (isSequence() == true) step.fid = getBoundSceneID(); if (stepNumber >= m_steps.size()) m_steps.append(step); else m_steps.insert(stepNumber, step); } } else { qWarning() << Q_FUNC_INFO << "Unknown chaser tag:" << tag.tagName(); } node = node.nextSibling(); } return true; }
bool Chaser::loadXML(QXmlStreamReader &root) { if (root.name() != KXMLQLCFunction) { qWarning() << Q_FUNC_INFO << "Function node not found"; return false; } if (root.attributes().value(KXMLQLCFunctionType).toString() != typeToString(Function::Chaser)) { qWarning() << Q_FUNC_INFO << root.attributes().value(KXMLQLCFunctionType).toString() << "is not a chaser"; return false; } /* Load chaser contents */ while (root.readNextStartElement()) { if (root.name() == KXMLQLCBus) { m_legacyHoldBus = root.readElementText().toUInt(); } else if (root.name() == KXMLQLCFunctionSpeed) { loadXMLSpeed(root); } else if (root.name() == KXMLQLCFunctionDirection) { loadXMLDirection(root); } else if (root.name() == KXMLQLCFunctionRunOrder) { loadXMLRunOrder(root); } else if (root.name() == KXMLQLCChaserSpeedModes) { QXmlStreamAttributes attrs = root.attributes(); QString str; str = attrs.value(KXMLQLCFunctionSpeedFadeIn).toString(); setFadeInMode(stringToSpeedMode(str)); str = attrs.value(KXMLQLCFunctionSpeedFadeOut).toString(); setFadeOutMode(stringToSpeedMode(str)); str = attrs.value(KXMLQLCFunctionSpeedDuration).toString(); setDurationMode(stringToSpeedMode(str)); root.skipCurrentElement(); } else if (root.name() == KXMLQLCChaserSequenceTag) { QXmlStreamAttributes attrs = root.attributes(); QString str = attrs.value(KXMLQLCChaserSequenceBoundScene).toString(); enableSequenceMode(str.toUInt()); if (attrs.hasAttribute(KXMLQLCChaserSequenceStartTime)) setStartTime(attrs.value(KXMLQLCChaserSequenceStartTime).toString().toUInt()); if (attrs.hasAttribute(KXMLQLCChaserSequenceColor)) setColor(QColor(attrs.value(KXMLQLCChaserSequenceColor).toString())); if (attrs.hasAttribute(KXMLQLCChaserSequenceLocked)) setLocked(true); root.skipCurrentElement(); } else if (root.name() == KXMLQLCFunctionStep) { //! @todo stepNumber is useless if the steps are in the wrong order ChaserStep step; int stepNumber = -1; if (step.loadXML(root, stepNumber) == true) { if (isSequence() == true) step.fid = getBoundSceneID(); if (stepNumber >= m_steps.size()) m_steps.append(step); else m_steps.insert(stepNumber, step); } } else { qWarning() << Q_FUNC_INFO << "Unknown chaser tag:" << root.name(); root.skipCurrentElement(); } } return true; }