Nepomuk-Core
codegenerator.cpp
Go to the documentation of this file.
141 bool CodeGenerator::writeHeader( const ResourceClass *resourceClass, QTextStream& stream ) const
172 qDebug() << "(CodeGenerator::writeSource) type not defined for property: " << p->name() << endl;
177 ms << writeComment( QString("Get property '%1'. ").arg(p->name()) + p->comment(), 2*4 ) << endl;
182 ms << writeComment( QString("Set property '%1'. ").arg(p->name()) + p->comment(), 2*4 ) << endl;
187 ms << writeComment( QString("Add a value to property '%1'. ").arg(p->name()) + p->comment(), 2*4 ) << endl;
192 ms << writeComment( QString( "\\return The URI of the property '%1'." ).arg( p->name() ), 2*4 ) << endl;
208 qDebug() << "(CodeGenerator::writeSource) type not defined for property: " << p->name() << endl;
219 .arg(p->name()) + p->comment() + QString(" \\sa ResourceManager::allResourcesWithProperty"), 2*4 ) << endl;
220 ms << " " << m_code->propertyReversePropertyGetterDeclaration( p, resourceClass ) << ";" << endl;
231 // So we have to use a workaround instead (we even include the one class used as "proper" superclass
232 // since the order of the super classes is not deterministic and may change with a different serialization)
275 bool CodeGenerator::writeSource( const ResourceClass* resourceClass, QTextStream& stream ) const
294 qDebug() << "(CodeGenerator::writeSource) type not defined for property: " << p->name() << endl;
310 ms << "QUrl " << resourceClass->name( m_nameSpace ) << "::" << p->name()[0].toLower() << p->name().mid(1) << "Uri()" << endl
323 qDebug() << "(CodeGenerator::writeSource) type not defined for property: " << p->name() << endl;
341 // So we have to use a workaround instead (we even include the one class used as "proper" superclass
342 // since the order of the super classes is not deterministic and may change with a different serialization)
bool isList() const
Returns whether the property is a list of values.
Definition: rcgen/property.cpp:88
virtual QString propertyAdderDefinition(const Property *property, const ResourceClass *resourceClass) const =0
Returns the definition of the property adder method.
QString literalRange() const
Returns the literal range of the property (the name of the Qt type to be used.)
Definition: rcgen/property.cpp:68
bool generateClass() const
Returns true if this class should be generated.
Definition: resourceclass.cpp:117
ResourceClass * parentClass(bool considerGenerateClass=true) const
Returns the parent resource of the resource.
Definition: resourceclass.cpp:63
static QString sourceTemplate(CodeGenerator::Mode mode)
Definition: codegenerator.cpp:48
Property::ConstPtrList allProperties() const
Returns the list of all properties of the resource.
Definition: resourceclass.cpp:97
virtual QString resourcePseudoInheritanceDeclaration(const ResourceClass *resourceBaseClass, const ResourceClass *resourceClass, const QString &nameSpace=QString()) const =0
Returns the declaration of the resource method that provides pseudo inheritance.
bool hasSimpleType() const
Returns whether the property is of simple type.
Definition: rcgen/property.cpp:159
virtual QString propertyAdderDeclaration(const Property *property, const ResourceClass *resourceClass, const QString &nameSpace=QString()) const =0
Returns the declaration of the property adder method.
virtual QString propertyGetterDefinition(const Property *property, const ResourceClass *resourceClass) const =0
Returns the definition of the property getter method.
static QString headerTemplate(CodeGenerator::Mode mode)
Definition: codegenerator.cpp:33
Property::ConstPtrList allReverseProperties() const
Returns the list of all reverse properties of the resource.
Definition: resourceclass.cpp:107
QString sourceName() const
Returns the name of the source file for this resource.
Definition: resourceclass.cpp:135
virtual QString propertyReversePropertyGetterDeclaration(const Property *property, const ResourceClass *resourceClass, const QString &nameSpace=QString()) const =0
Returns the declaration of the property for the reverse property getter method.
static QString writeComment(const QString &comment, int indent)
Definition: codegenerator.cpp:63
ResourceClass * domain(bool onlyReturnGeneratedClass=false) const
Returns the domain resource the property belongs to.
Definition: rcgen/property.cpp:98
QString name(const QString &nameSpace=QString()) const
Returns the name of the resource.
Definition: resourceclass.cpp:122
virtual QString propertySetterDefinition(const Property *property, const ResourceClass *resourceClass) const =0
Returns the definition of the property setter method.
CodeGenerator(Mode mode, const QList< ResourceClass * > &classes)
Definition: codegenerator.cpp:98
QString headerName() const
Returns the name of the header file for this resource.
Definition: resourceclass.cpp:130
Property * inverseProperty() const
Returns the inverse property of this property.
Definition: rcgen/property.cpp:114
QString typeString(bool simple=false, const QString &nameSpace=QString()) const
Retrieve a string representation of the range.
Definition: rcgen/property.cpp:132
virtual QString propertyGetterDeclaration(const Property *property, const ResourceClass *resourceClass, const QString &nameSpace=QString()) const =0
Returns the declaration of the property getter method.
Definition: codegenerator.h:30
virtual QString propertySetterDeclaration(const Property *property, const ResourceClass *resourceClass, const QString &nameSpace=QString()) const =0
Returns the declaration of the property setter method.
QList< ResourceClass * > allParentResources() const
Returns all parent resource of the resource.
Definition: resourceclass.cpp:87
virtual QString resourcePseudoInheritanceDefinition(const ResourceClass *resourceBaseClass, const ResourceClass *resourceClass) const =0
Returns the definition of the resource method that provides pseudo inheritance.
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.