knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::StringTemplate< StrType > Class Template Reference

#include <String.h>

Inheritance diagram for knowrob::StringTemplate< StrType >:
Collaboration diagram for knowrob::StringTemplate< StrType >:

Public Member Functions

 StringTemplate (std::string_view str)
 
 ~StringTemplate () override=default
 
std::string_view stringForm () const override
 
void write (std::ostream &os) const override
 
 StringTemplate (std::string_view str)
 
 ~StringTemplate () override=default
 
std::string_view stringForm () const override
 
void write (std::ostream &os) const override
 
- Public Member Functions inherited from knowrob::StringBase
 StringBase ()
 
 ~StringBase () override=default
 
bool isSameString (const StringBase &other) const
 
 StringBase ()
 
 ~StringBase () override=default
 
bool isSameString (const StringBase &other) const
 
- Public Member Functions inherited from knowrob::XSDAtomic
 XSDAtomic (XSDType xsdType)
 
std::string_view xsdTypeIRI () const
 
XSDType xsdType () const
 
 XSDAtomic (XSDType xsdType)
 
std::string_view xsdTypeIRI () const
 
XSDType xsdType () const
 
- Public Member Functions inherited from knowrob::RDFNode
 RDFNode (RDFNodeType rdfNodeType)
 
auto rdfNodeType () const
 
 RDFNode (RDFNodeType rdfNodeType)
 
auto rdfNodeType () const
 
- Public Member Functions inherited from knowrob::Atomic
 Atomic (AtomicType atomicType)
 
 ~Atomic () override=default
 
bool isSameAtomic (const Atomic &other) const
 
AtomicType atomicType () const
 
size_t hashOfAtomic () const
 
const std::set< std::string_view > & variables () const final
 
 Atomic (AtomicType atomicType)
 
 ~Atomic () override=default
 
bool isSameAtomic (const Atomic &other) const
 
AtomicType atomicType () const
 
size_t hashOfAtomic () const
 
const std::set< std::string_view > & variables () const final
 
- Public Member Functions inherited from knowrob::Term
 Term (TermType termType)
 
 ~Term () override=default
 
bool operator== (const Term &other) const
 
bool operator!= (const Term &other) const
 
TermType termType () const
 
bool isGround () const
 
bool isAtomic () const
 
bool isAtom () const
 
bool isVariable () const
 
bool isFunction () const
 
bool isNumeric () const
 
bool isString () const
 
bool isIRI () const
 
bool isBlank () const
 
size_t hash () const
 
 Term (TermType termType)
 
 ~Term () override=default
 
bool operator== (const Term &other) const
 
bool operator!= (const Term &other) const
 
TermType termType () const
 
bool isGround () const
 
bool isAtomic () const
 
bool isAtom () const
 
bool isVariable () const
 
bool isFunction () const
 
bool isNumeric () const
 
bool isString () const
 
bool isIRI () const
 
bool isBlank () const
 
size_t hash () const
 
- Public Member Functions inherited from knowrob::Printable
virtual ~Printable ()=default
 
virtual std::string format () const
 
virtual ~Printable ()=default
 
virtual std::string format () const
 

Protected Attributes

StrType str_
 
- Protected Attributes inherited from knowrob::XSDAtomic
XSDType xsdType_
 
- Protected Attributes inherited from knowrob::RDFNode
const RDFNodeType rdfNodeType_
 
- Protected Attributes inherited from knowrob::Atomic
const AtomicType atomicType_
 
- Protected Attributes inherited from knowrob::Term
const TermType termType_
 
bool isBlank_ = false
 
bool isIRI_ = false
 

Additional Inherited Members

- Static Public Member Functions inherited from knowrob::XSDAtomic
static std::shared_ptr< XSDAtomiccreate (std::string_view lexicalForm, std::string_view xsdTypeIRI)
 
static std::shared_ptr< XSDAtomiccreate (std::string_view lexicalForm, std::string_view xsdTypeIRI)
 
- Static Public Member Functions inherited from knowrob::Atomic
static std::shared_ptr< AtomicmakeTripleValue (const Triple &triple)
 
static std::shared_ptr< AtomicmakeTripleValue (const Triple &triple)
 
- Static Protected Attributes inherited from knowrob::Term
static const std::set< std::string_view > noVariables_ = {}
 

Detailed Description

template<typename StrType>
class knowrob::StringTemplate< StrType >

A template class for string terms which stores a string of type StrType.

Template Parameters
StrTypethe type of the string

Definition at line 37 of file String.h.

Constructor & Destructor Documentation

◆ StringTemplate() [1/2]

template<typename StrType >
knowrob::StringTemplate< StrType >::StringTemplate ( std::string_view  str)
inlineexplicit

Definition at line 39 of file String.h.

39 : str_(str) {}

◆ ~StringTemplate() [1/2]

template<typename StrType >
knowrob::StringTemplate< StrType >::~StringTemplate ( )
overridedefault

◆ StringTemplate() [2/2]

template<typename StrType >
knowrob::StringTemplate< StrType >::StringTemplate ( std::string_view  str)
inlineexplicit

Definition at line 39 of file String.h.

39 : str_(str) {}

◆ ~StringTemplate() [2/2]

template<typename StrType >
knowrob::StringTemplate< StrType >::~StringTemplate ( )
overridedefault

Member Function Documentation

◆ stringForm() [1/2]

template<typename StrType >
std::string_view knowrob::StringTemplate< StrType >::stringForm ( ) const
inlineoverridevirtual

Get the lexical form of this atomic term.

Returns
the lexical form of this atomic term.

Implements knowrob::Atomic.

Definition at line 44 of file String.h.

44 { return str_; }

◆ stringForm() [2/2]

template<typename StrType >
std::string_view knowrob::StringTemplate< StrType >::stringForm ( ) const
inlineoverridevirtual

Get the lexical form of this atomic term.

Returns
the lexical form of this atomic term.

Implements knowrob::Atomic.

Definition at line 44 of file String.h.

44 { return str_; }

◆ write() [1/2]

template<typename StrType >
void knowrob::StringTemplate< StrType >::write ( std::ostream &  os) const
inlineoverridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Reimplemented from knowrob::StringBase.

Definition at line 47 of file String.h.

47 { os << '"' << str_ << '"'; }

◆ write() [2/2]

template<typename StrType >
void knowrob::StringTemplate< StrType >::write ( std::ostream &  os) const
inlineoverridevirtual

Print this object to a stream.

Parameters
osthe stream to print to.

Reimplemented from knowrob::StringBase.

Definition at line 47 of file String.h.

47 { os << '"' << str_ << '"'; }

Member Data Documentation

◆ str_

template<typename StrType >
StrType knowrob::StringTemplate< StrType >::str_
protected

Definition at line 50 of file String.h.


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