MICO Platform
 All Classes Namespaces Functions Variables Friends
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mico::rdf::model::Literal Class Reference

An RDF literal consisting of a label (the value) and optionally a language tag or a datatype (but not both). More...

#include <rdf_model.hpp>

Inheritance diagram for mico::rdf::model::Literal:
mico::rdf::model::Value mico::rdf::model::DatatypeLiteral mico::rdf::model::LanguageLiteral

Public Member Functions

 Literal (const std::string &label)
 
 Literal (const char *label)
 
 Literal (int8_t i)
 
 Literal (int16_t i)
 
 Literal (int32_t i)
 
 Literal (int64_t i)
 
 Literal (double d)
 
 Literal (float d)
 
 Literal (bool b)
 
bool booleanValue () const
 Returns the boolean value of this literal.
 
int8_t byteValue () const
 Returns the byte value of this literal.
 
cpp_dec_float_50 decimalValue () const
 Returns the decimal value of this literal.
 
double doubleValue () const
 Returns the double value of this literal.
 
float floatValue () const
 Returns the float value of this literal.
 
cpp_int integerValue () const
 Returns the integer value of this literal.
 
int32_t intValue () const
 Returns the 32 bit int value of this literal.
 
int64_t longValue () const
 Returns the 64 bit long value of this literal.
 
int16_t shortValue () const
 Returns the 16 bit short value of this literal.
 
const std::string & getLabel () const
 Gets the label of this literal.
 
const std::string & stringValue () const
 Returns the String-value of a Value object. More...
 
const ValueTypes getType () const
 Return type information (to avoid dynamic casts if possible)
 
bool operator== (const std::string &s) const
 
bool operator!= (const std::string &s) const
 
 operator bool () const
 
 operator int () const
 
 operator long int () const
 
 operator long long int () const
 
 operator float () const
 
 operator double () const
 
 operator const char * () const
 

Protected Member Functions

virtual bool equals (const Value &other) const
 Internal polymorphic implementation of equals.
 
virtual std::ostream & print (std::ostream &os) const
 

Protected Attributes

std::string label
 

Detailed Description

An RDF literal consisting of a label (the value) and optionally a language tag or a datatype (but not both).

Member Function Documentation

const std::string& mico::rdf::model::Literal::stringValue ( ) const
inlinevirtual

Returns the String-value of a Value object.

This returns either a Literal's label, a URI's URI or a BNode's ID.

Implements mico::rdf::model::Value.


The documentation for this class was generated from the following files: