| 1 | /* |
| 2 | This file is part of the syndication library |
| 3 | SPDX-FileCopyrightText: 2006 Frank Osterfeld <[email protected]> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef SYNDICATION_RDF_LITERAL_H |
| 9 | #define SYNDICATION_RDF_LITERAL_Hcxx . . $ `src/rdf/literal.h:9:9`! |
| 10 | |
| 11 | #include <QString> |
| 12 | #include <syndication/rdf/node.h>cxx . . $ `<file>/build/src/syndication/rdf/node.h`/ |
| 13 | |
| 14 | namespace Syndicationcxx . . $ Syndication/ |
| 15 | { |
| 16 | namespace RDFcxx . . $ Syndication/RDF/ |
| 17 | { |
| 18 | class Literalcxx . . $ Syndication/RDF/Literal#; |
| 19 | |
| 20 | //@cond PRIVATE |
| 21 | typedef QSharedPointercxx . . $ QSharedPointer#<Literalcxx . . $ Syndication/RDF/Literal#> LiteralPtrcxx . . $ Syndication/RDF/LiteralPtr#; |
| 22 | //@endcond |
| 23 | |
| 24 | /*! |
| 25 | * a node type representing simple string values. Literals can |
| 26 | * be object of statement, but neither subject nor predicate. |
| 27 | */ |
| 28 | class Literalcxx . . $ Syndication/RDF/Literal# : public Nodecxx . . $ Syndication/RDF/Node# |
| 29 | { |
| 30 | public: |
| 31 | /*! |
| 32 | * creates a null literal. text() will return a null string. |
| 33 | */ |
| 34 | Literalcxx . . $ Syndication/RDF/Literal#Literal(49f6e7a06ebc5aa8).(); |
| 35 | |
| 36 | /*! |
| 37 | * copies a literal node |
| 38 | * |
| 39 | * \a other the literal node to copy |
| 40 | */ |
| 41 | Literalcxx . . $ Syndication/RDF/Literal#Literal(925f598c47761f7f).(const Literalcxx . . $ Syndication/RDF/Literal# &other); |
| 42 | |
| 43 | /*! |
| 44 | * creates a new literal node with a given text |
| 45 | * |
| 46 | * \a text the literal string |
| 47 | */ |
| 48 | explicit Literalcxx . . $ Syndication/RDF/Literal#Literal(3520e46b33348bf6).(const QStringcxx . . $ QString# &text); |
| 49 | |
| 50 | /*! |
| 51 | * destructor |
| 52 | */ |
| 53 | ~cxx . . $ Syndication/RDF/Literal#`~Literal`(ced63f7c635d850d).Literalcxx . . $ Syndication/RDF/Literal#() override; |
| 54 | |
| 55 | /*! |
| 56 | * assigns another literal |
| 57 | * |
| 58 | * \a other the literal to assign |
| 59 | */ |
| 60 | virtual Literalcxx . . $ Syndication/RDF/Literal# &operatorcxx . . $ Syndication/RDF/Literal#`operator=`(5ad37260e900caf1).=(const Literalcxx . . $ Syndication/RDF/Literal# &other); |
| 61 | |
| 62 | /*! |
| 63 | * two literal nodes are equal iff their text _and_ ID's |
| 64 | * are equal. |
| 65 | */ |
| 66 | bool operatorcxx . . $ Syndication/RDF/Literal#`operator==`(8f29c3037648f2a7).==(const Literalcxx . . $ Syndication/RDF/Literal# &other) const; |
| 67 | |
| 68 | /*! |
| 69 | * clones the literal node. |
| 70 | */ |
| 71 | Literalcxx . . $ Syndication/RDF/Literal# *clonecxx . . $ Syndication/RDF/Literal#clone(52c06153f18b4a1e).() const override; |
| 72 | |
| 73 | /*! |
| 74 | * Used by visitors for double dispatch. See NodeVisitor |
| 75 | * for more information. |
| 76 | * \a visitor the visitor calling the method |
| 77 | * \a ptr a shared pointer object for this node |
| 78 | */ |
| 79 | void acceptcxx . . $ Syndication/RDF/Literal#accept(39e70c9c4cf709e6).(NodeVisitorcxx . . $ Syndication/RDF/NodeVisitor# *visitor, NodePtrcxx . . $ Syndication/RDF/NodePtr# ptr) override; |
| 80 | |
| 81 | /*! |
| 82 | * returns whether this node is a null node |
| 83 | */ |
| 84 | bool isNullcxx . . $ Syndication/RDF/Literal#isNull(50ce9a9e25b4a850).() const override; |
| 85 | |
| 86 | /*! |
| 87 | * the identifier of this node. the ID is unique per model |
| 88 | * and set by the associated model at creation time. |
| 89 | */ |
| 90 | unsigned int idcxx . . $ Syndication/RDF/Literal#id(ddd8539a2fcdd4ce).() const override; |
| 91 | |
| 92 | /*! |
| 93 | * returns false, as a literal is not a resource |
| 94 | */ |
| 95 | bool isResourcecxx . . $ Syndication/RDF/Literal#isResource(50ce9a9e25b4a850).() const override; |
| 96 | /*! |
| 97 | * returns false, as a literal is not a property |
| 98 | */ |
| 99 | bool isPropertycxx . . $ Syndication/RDF/Literal#isProperty(50ce9a9e25b4a850).() const override; |
| 100 | |
| 101 | /*! |
| 102 | * returns true for literals |
| 103 | */ |
| 104 | bool isLiteralcxx . . $ Syndication/RDF/Literal#isLiteral(50ce9a9e25b4a850).() const override; |
| 105 | |
| 106 | /*! |
| 107 | * returns false, literals are not anonymous resources |
| 108 | */ |
| 109 | bool isAnoncxx . . $ Syndication/RDF/Literal#isAnon(50ce9a9e25b4a850).() const override; |
| 110 | |
| 111 | /*! |
| 112 | * returns false, literals are not sequences |
| 113 | */ |
| 114 | bool isSequencecxx . . $ Syndication/RDF/Literal#isSequence(50ce9a9e25b4a850).() const override; |
| 115 | |
| 116 | /*! |
| 117 | * implicit conversion to string. returns text() |
| 118 | */ |
| 119 | virtual operatorcxx . . $ Syndication/RDF/Literal#`operator QString`(6ef7b6c27b00b43d). QStringcxx . . $ QString#() const; |
| 120 | |
| 121 | /*! |
| 122 | * the string value of the literal |
| 123 | */ |
| 124 | QStringcxx . . $ QString# textcxx . . $ Syndication/RDF/Literal#text(6ef7b6c27b00b43d).() const override; |
| 125 | |
| 126 | /*! |
| 127 | * used in Model |
| 128 | * @internal |
| 129 | */ |
| 130 | void setModelcxx . . $ Syndication/RDF/Literal#setModel(8871691be156df2e).(const Modelcxx . . $ Syndication/RDF/Model# &model) override; |
| 131 | |
| 132 | /*! |
| 133 | * used in Model |
| 134 | * @internal |
| 135 | */ |
| 136 | void setIdcxx . . $ Syndication/RDF/Literal#setId(cb2f890c2fdad230).(unsigned int id) override; |
| 137 | |
| 138 | private: |
| 139 | class LiteralPrivatecxx . . $ Syndication/RDF/Literal#LiteralPrivate#; |
| 140 | typedef QSharedPointercxx . . $ QSharedPointer#<LiteralPrivatecxx . . $ Syndication/RDF/Literal#LiteralPrivate#> LiteralPrivatePtrcxx . . $ Syndication/RDF/Literal#LiteralPrivatePtr#; |
| 141 | LiteralPrivatePtrcxx . . $ Syndication/RDF/Literal#LiteralPrivatePtr# dcxx . . $ Syndication/RDF/Literal#d.; |
| 142 | }; |
| 143 | |
| 144 | } // namespace RDF |
| 145 | } // namespace Syndication |
| 146 | |
| 147 | #endif // SYNDICATION_RDF_LITERAL_H |