コード例 #1
0
ファイル: inputcell.cpp プロジェクト: hkiel/OMNotebook
  void InputCell::accept(Visitor &v)
  {
    v.visitInputCellNodeBefore(this);

    if(hasChilds())
      child()->accept(v);

    v.visitInputCellNodeAfter(this);

    if(hasNext())
      next()->accept(v);
  }
コード例 #2
0
ファイル: xmldomelement.cpp プロジェクト: 0xB767B/LibrePCB
QString XmlDomElement::getText<QString>(bool throwIfEmpty, const QString& defaultValue) const throw (Exception)
{
    Q_UNUSED(defaultValue);
    Q_ASSERT(defaultValue == QString()); // defaultValue makes no sense in this method

    if (hasChilds())
    {
        throw FileParseError(__FILE__, __LINE__, getDocFilePath(), -1, -1, mName,
                             tr("A node with child elements cannot have a text."));
    }
    if (mText.isEmpty() && throwIfEmpty)
    {
        throw FileParseError(__FILE__, __LINE__, getDocFilePath(), -1, -1, mName,
                             tr("The node text must not be empty."));
    }
    return mText;
}