sptk2 logo
SPTK Home Page
Public Member Functions | Protected Member Functions | List of all members
sptk::WSBasicType Class Reference

#include <WSBasicTypes.h>

Inheritance diagram for sptk::WSBasicType:
sptk::WSType sptk::WSBool sptk::WSDate sptk::WSDateTime sptk::WSDouble sptk::WSInteger sptk::WSString

Public Member Functions

 WSBasicType ()=default
 
 WSBasicType (const char *name, bool optional)
 
 WSBasicType (const WSBasicType &other)=default
 
 WSBasicType (WSBasicType &&other) noexcept=default
 
WSBasicTypeoperator= (const WSBasicType &other)
 
WSBasicTypeoperator= (WSBasicType &&other) noexcept
 
bool optional () const
 
void optional (bool opt)
 
void clear () override
 
void load (const xdoc::SNode &attr, bool nullLargeData) override
 
virtual void load (const String &attr)
 
virtual void load (const Field &field)
 
virtual operator String () const
 
String asString () const override
 
auto asInteger () const
 
auto asInt64 () const
 
auto asFloat () const
 
auto asBool () const
 
void setInteger (int32_t _value)
 
void setInt64 (int64_t _value)
 
void setFloat (bool _value)
 
void setBool (bool _value)
 
void setBuffer (const char *buffer, size_t size)
 
bool isNull () const override
 
void throwIfNull (const String &parentTypeName) const
 
size_t dataSize () const
 
VariantDataType dataType () const
 
void setNull ()
 
Variantvalue ()
 
const Variantvalue () const
 
void exportTo (const xdoc::SNode &parent, const char *name=nullptr) const override
 
- Public Member Functions inherited from sptk::WSType
 WSType ()=default
 
 WSType (const char *name)
 
 WSType (const WSType &)=default
 
 WSType (WSType &&) noexcept=default
 
WSTypeoperator= (const WSType &)
 
WSTypeoperator= (WSType &&) noexcept
 
virtual String className () const
 
virtual String name () const
 
virtual void owaspCheck (const String &value)
 
virtual void clear ()=0
 
virtual void load (const xdoc::SNode &attr, bool nullLargeData=false)=0
 
virtual String asString () const
 
virtual bool isNull () const =0
 
virtual void exportTo (const xdoc::SNode &parent, const char *name=nullptr) const =0
 

Protected Member Functions

void setNull (VariantDataType dataType)
 
virtual VariantDataType defaultDataType () const
 Default data type. More...
 

Detailed Description

Base type for all standard WSDL types

Constructor & Destructor Documentation

◆ WSBasicType() [1/2]

sptk::WSBasicType::WSBasicType ( )
default

Constructor

◆ WSBasicType() [2/2]

sptk::WSBasicType::WSBasicType ( const char *  name,
bool  optional 
)
inline

Constructor

Parameters
nameWSDL element name
optionalElement optionality flag

Member Function Documentation

◆ asString()

String sptk::WSBasicType::asString ( ) const
inlineoverridevirtual

Conversion to string

Reimplemented from sptk::WSType.

Reimplemented in sptk::WSDateTime.

◆ clear()

void sptk::WSBasicType::clear ( )
inlineoverridevirtual

Clears content (sets to NULL)

Implements sptk::WSType.

◆ defaultDataType()

virtual VariantDataType sptk::WSBasicType::defaultDataType ( ) const
inlineprotectedvirtual

Default data type.

Used in clear operations

Returns
Default data type for the class

Reimplemented in sptk::WSString, sptk::WSBool, sptk::WSDate, sptk::WSDateTime, sptk::WSDouble, and sptk::WSInteger.

References VAR_NONE.

◆ exportTo()

void sptk::WSBasicType::exportTo ( const xdoc::SNode &  parent,
const char *  name = nullptr 
) const
overridevirtual

Adds an element to response XML with this object data

Parameters
parentParent XML element
nameOptional name for child element

Implements sptk::WSType.

◆ isNull()

bool sptk::WSBasicType::isNull ( ) const
inlineoverridevirtual

Implements sptk::WSType.

◆ load() [1/3]

virtual void sptk::WSBasicType::load ( const Field field)
inlinevirtual

Loads type data from database field

Parameters
fieldDatabase field

Reimplemented in sptk::WSString, sptk::WSBool, sptk::WSDate, sptk::WSDateTime, sptk::WSDouble, and sptk::WSInteger.

◆ load() [2/3]

virtual void sptk::WSBasicType::load ( const String attr)
inlinevirtual

Loads type data from string

Parameters
attrA string

Reimplemented in sptk::WSString, sptk::WSBool, sptk::WSDate, sptk::WSDateTime, sptk::WSDouble, and sptk::WSInteger.

◆ load() [3/3]

void sptk::WSBasicType::load ( const xdoc::SNode &  attr,
bool  nullLargeData 
)
inlineoverridevirtual

Loads type data from request XML node

Parameters
attrXML node

Implements sptk::WSType.

Reimplemented in sptk::WSString, sptk::WSBool, sptk::WSDate, sptk::WSDateTime, sptk::WSDouble, and sptk::WSInteger.

References VAR_STRING.

◆ operator String()

virtual sptk::WSBasicType::operator String ( ) const
inlinevirtual

Returns element name

Reimplemented in sptk::WSString.

◆ optional() [1/2]

bool sptk::WSBasicType::optional ( ) const
inline

Return true if value is optional

Returns
true if value is optional

◆ optional() [2/2]

void sptk::WSBasicType::optional ( bool  opt)
inline

Sets optionality flag

Parameters
optElement optionality flag

◆ throwIfNull()

void sptk::WSBasicType::throwIfNull ( const String parentTypeName) const

Throw SOAPException is the object is null

Parameters
parentTypeNameParent object type name

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

Fri Oct 14 2022 09:58:47: SPTK 5.4.1