Syndication::RDF::Literal

Search for usage in LXR

Syndication::RDF::Literal Class Reference

#include <literal.h>

Inheritance diagram for Syndication::RDF::Literal:

Public Member Functions

 Literal ()
 
 Literal (const Literal &other)
 
 Literal (const QString &text)
 
 ~Literal () override
 
void accept (NodeVisitor *visitor, NodePtr ptr) override
 
Literalclone () const override
 
unsigned int id () const override
 
bool isAnon () const override
 
bool isLiteral () const override
 
bool isNull () const override
 
bool isProperty () const override
 
bool isResource () const override
 
bool isSequence () const override
 
virtual operator QString () const
 
virtual Literaloperator= (const Literal &other)
 
bool operator== (const Literal &other) const
 
void setId (unsigned int id) override
 
void setModel (const Model &model) override
 
QString text () const override
 
- Public Member Functions inherited from Syndication::RDF::Node
virtual ~Node ()
 

Additional Inherited Members

- Static Protected Attributes inherited from Syndication::RDF::Node
static unsigned int idCounter = 1
 

Detailed Description

a node type representing simple string values.

Literals can be object of statement, but neither subject nor predicate.

Definition at line 28 of file literal.h.

Constructor & Destructor Documentation

◆ Literal() [1/3]

Syndication::RDF::Literal::Literal ( )

creates a null literal.

text() will return a null string.

Definition at line 27 of file literal.cpp.

◆ Literal() [2/3]

Syndication::RDF::Literal::Literal ( const Literal & other)

copies a literal node

Parameters
otherthe literal node to copy

Definition at line 32 of file literal.cpp.

◆ Literal() [3/3]

Syndication::RDF::Literal::Literal ( const QString & text)
explicit

creates a new literal node with a given text

Parameters
textthe literal string

Definition at line 51 of file literal.cpp.

◆ ~Literal()

Syndication::RDF::Literal::~Literal ( )
override

destructor

Definition at line 58 of file literal.cpp.

Member Function Documentation

◆ accept()

void Syndication::RDF::Literal::accept ( NodeVisitor * visitor,
NodePtr ptr )
overridevirtual

Used by visitors for double dispatch.

See NodeVisitor for more information.

Parameters
visitorthe visitor calling the method
ptra shared pointer object for this node

Reimplemented from Syndication::RDF::Node.

Definition at line 43 of file literal.cpp.

◆ clone()

Literal * Syndication::RDF::Literal::clone ( ) const
overridevirtual

clones the literal node.

Implements Syndication::RDF::Node.

Definition at line 38 of file literal.cpp.

◆ id()

unsigned int Syndication::RDF::Literal::id ( ) const
overridevirtual

the identifier of this node.

the ID is unique per model and set by the associated model at creation time.

Implements Syndication::RDF::Node.

Definition at line 82 of file literal.cpp.

◆ isAnon()

bool Syndication::RDF::Literal::isAnon ( ) const
overridevirtual

returns false, literals are not anonymous resources

Implements Syndication::RDF::Node.

Definition at line 102 of file literal.cpp.

◆ isLiteral()

bool Syndication::RDF::Literal::isLiteral ( ) const
overridevirtual

returns true for literals

Implements Syndication::RDF::Node.

Definition at line 97 of file literal.cpp.

◆ isNull()

bool Syndication::RDF::Literal::isNull ( ) const
overridevirtual

returns whether this node is a null node

Implements Syndication::RDF::Node.

Definition at line 77 of file literal.cpp.

◆ isProperty()

bool Syndication::RDF::Literal::isProperty ( ) const
overridevirtual

returns false, as a literal is not a property

Implements Syndication::RDF::Node.

Definition at line 92 of file literal.cpp.

◆ isResource()

bool Syndication::RDF::Literal::isResource ( ) const
overridevirtual

returns false, as a literal is not a resource

Implements Syndication::RDF::Node.

Definition at line 87 of file literal.cpp.

◆ isSequence()

bool Syndication::RDF::Literal::isSequence ( ) const
overridevirtual

returns false, literals are not sequences

Implements Syndication::RDF::Node.

Definition at line 107 of file literal.cpp.

◆ operator QString()

Syndication::RDF::Literal::operator QString ( ) const
virtual

implicit conversion to string.

returns text()

Definition at line 117 of file literal.cpp.

◆ operator=()

Literal & Syndication::RDF::Literal::operator= ( const Literal & other)
virtual

assigns another literal

Parameters
otherthe literal to assign

Definition at line 62 of file literal.cpp.

◆ operator==()

bool Syndication::RDF::Literal::operator== ( const Literal & other) const

two literal nodes are equal iff their text and ID's are equal.

Definition at line 68 of file literal.cpp.

◆ setId()

void Syndication::RDF::Literal::setId ( unsigned int id)
overridevirtual

used in Model

Implements Syndication::RDF::Node.

Definition at line 126 of file literal.cpp.

◆ setModel()

void Syndication::RDF::Literal::setModel ( const Model & model)
overridevirtual

used in Model

Implements Syndication::RDF::Node.

Definition at line 122 of file literal.cpp.

◆ text()

QString Syndication::RDF::Literal::text ( ) const
overridevirtual

the string value of the literal

Implements Syndication::RDF::Node.

Definition at line 112 of file literal.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:09:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.