SASSY  0.0
Software Architecture Support System
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
rdf::Literal Class Reference

Hold the value, language and data type for an RDF literal. More...

#include <rdfxx/rdfxx.h>

Public Member Functions

 Literal ()
 Default constructor.
 
 Literal (const std::string &val)
 Create a PlainLiteral with English language.
 
 Literal (const char *val)
 Create a PlainLiteral with English language.
 
 Literal (const std::string &val, const std::string &lan)
 Create a PlainLiteral with the specified language.
 
 Literal (const std::string &val, DataType, const std::string &lan="en")
 Create a literal with the specified content, data type and/or language.
 
 Literal (int, DataType)
 Create a literal with some type of integral value.
 
 Literal (double, DataType)
 Create a literal with some type of real number value.
 
 Literal (bool)
 Create a literal with a boolean value.
 
void language (const std::string &lang)
 Set the language.
 
void dataType (DataType t)
 Set the data type.
 
void value (const std::string &v)
 Set the value.
 
std::string toString () const
 Default conversion to a string.
 
std::string toString (const Format &) const
 Convert to astringusing the specified format.
 
DataType dataType () const
 Get the data type.
 
URI dataTypeURI (World) const
 Get the data type as a URI.
 
std::string language () const
 Get the language.
 
std::string asString () const
 Get the value as a string.
 
int asInteger () const
 Get the value as an integer.
 
double asDouble () const
 Get the value as a double.
 
bool asBoolean () const
 Get the value as a boolean.
 

Static Public Member Functions

static std::string toXSD (DataType)
 Convert a data type into an xsd form,.
 
static std::string toTypeName (DataType)
 
static DataType toDataType (const std::string &xsd_type)
 Convert an xsd form into a data type.
 
static DataType asDataType (const std::string &type_name)
 
static std::vector< std::string > getDataTypeNames ()
 

Detailed Description

Hold the value, language and data type for an RDF literal.


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