UA Server SDK C++ Bundle  1.4.1.271
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
UaByteString Class Reference

Wrapper class for the UA stack structure OpcUa_ByteString. More...

#include <uabytestring.h>

Inherits OpcUa_ByteString.

Public Member Functions

 UaByteString ()
 construction
 
 UaByteString (const UaByteString &other)
 construction More...
 
 UaByteString (const OpcUa_ByteString &other)
 construction More...
 
 UaByteString (OpcUa_Int32 Length, OpcUa_Byte *pData)
 construction More...
 
 ~UaByteString ()
 destruction
 
void clear ()
 Clear the data of the UaByteString. More...
 
void setByteString (OpcUa_Int32 Length, OpcUa_Byte *pData)
 Set ByteString data. More...
 
UaByteStringoperator= (const UaByteString &other)
 Assignment operator. More...
 
void operator<< (const UaByteString &)
 Appends the other byte string. More...
 
bool operator== (const UaByteString &) const
 Compare variables if they are similar. More...
 
bool operator!= (const UaByteString &) const
 Returns true if other is not equal to this. More...
 
bool operator< (const UaByteString &) const
 Is lower than operator. More...
 
bool operator> (const UaByteString &) const
 Is greater than operator. More...
 
 operator const OpcUa_ByteString * () const
 Return internal OpcUa_ByteString structure. More...
 
OpcUa_ByteString * copy () const
 Copy UaByteString data to a newly allocated OpcUa_ByteString. More...
 
void copyTo (OpcUa_ByteString *pDst) const
 Copy UaByteString data to an existing OpcUa_ByteString structure. More...
 
void detach ()
 Detach internal structure from data. More...
 
void attach (const OpcUa_ByteString *pSrc)
 Attach the internal byte string data of the passed byte string to the own byte string. More...
 
UaByteStringappend (const UaByteString &other)
 Append a byte string to the own byte string. More...
 
OpcUa_Int32 length () const
 Get the length of the var. More...
 
const OpcUa_Byte * data () const
 Get the data of the actual variable. More...
 

Static Public Member Functions

static bool compare (const OpcUa_ByteString &, const OpcUa_ByteString &)
 Compare two UaByteString variables. More...
 
static OpcUa_ByteString * clone (const OpcUa_ByteString &source)
 Copy OpcUa_ByteString data to a newly allocated OpcUa_ByteString. More...
 
static void cloneTo (const OpcUa_ByteString &source, OpcUa_ByteString &copy)
 Copy OpcUa_ByteString data to an existing OpcUa_ByteString structure. More...
 
static char * base64encode (const OpcUa_ByteString rawData)
 This method encodes the passed ByteString into a BASE64 encoded string. More...
 
static OpcUa_StatusCode base64decode (const char *pBase64, UaByteString &rawData)
 This method decodes a BASE64 encoded string and returns the decoded data. More...
 

Detailed Description

Wrapper class for the UA stack structure OpcUa_ByteString.

Derived from OpcUa_ByteString.

Constructor & Destructor Documentation

UaByteString::UaByteString ( const UaByteString other)

construction

Parameters
otherthe UaBytestring
UaByteString::UaByteString ( const OpcUa_ByteString &  other)

construction

Parameters
otherthe OpcUa_ByteString
UaByteString::UaByteString ( OpcUa_Int32  iLength,
OpcUa_Byte *  pData 
)

construction

Parameters
iLengththe length of the data.
pDataa pointer to the data itself.

Member Function Documentation

UaByteString & UaByteString::append ( const UaByteString other)

Append a byte string to the own byte string.

Parameters
otherthe byte string to append
void UaByteString::attach ( const OpcUa_ByteString *  pSrc)

Attach the internal byte string data of the passed byte string to the own byte string.

Parameters
pSrcthe source of this operation.
OpcUa_StatusCode UaByteString::base64decode ( const char *  pBase64,
UaByteString rawData 
)
static

This method decodes a BASE64 encoded string and returns the decoded data.

Parameters
pBase64[in] The BASE64 string
rawData[out] The decoded raw data
Returns
Returns the result code for the operation.
char * UaByteString::base64encode ( const OpcUa_ByteString  rawData)
static

This method encodes the passed ByteString into a BASE64 encoded string.

Parameters
rawDataByteString to encode
Returns
Returns the encoded string. Must be deleted with delete[].
void UaByteString::clear ( )

Clear the data of the UaByteString.

OpcUa_ByteString * UaByteString::clone ( const OpcUa_ByteString &  source)
static

Copy OpcUa_ByteString data to a newly allocated OpcUa_ByteString.

Parameters
sourcethe source of this operation.
Returns
a newly allocated OpcUa_ByteString.
void UaByteString::cloneTo ( const OpcUa_ByteString &  source,
OpcUa_ByteString &  copy 
)
static

Copy OpcUa_ByteString data to an existing OpcUa_ByteString structure.

Parameters
sourceSource OpcUa_ByteString to clone.
copyNew copy of source OpcUa_ByteString.
bool UaByteString::compare ( const OpcUa_ByteString &  data1,
const OpcUa_ByteString &  data2 
)
static

Compare two UaByteString variables.

Parameters
data1a value as UaByteString.
data2a value as UaByteString.
Returns
true if equal false if not.
OpcUa_ByteString * UaByteString::copy ( ) const

Copy UaByteString data to a newly allocated OpcUa_ByteString.

Returns
a newly allocated OpcUa_ByteString.
void UaByteString::copyTo ( OpcUa_ByteString *  pDst) const

Copy UaByteString data to an existing OpcUa_ByteString structure.

Parameters
pDstthe destination of the copy operation.
const OpcUa_Byte* UaByteString::data ( ) const
inline

Get the data of the actual variable.

Returns
the data of the actual variable.
void UaByteString::detach ( )

Detach internal structure from data.

A caller must take ownership of the internal memory before calling detach.

OpcUa_Int32 UaByteString::length ( ) const
inline

Get the length of the var.

Returns
the length of the var.
UaByteString::operator const OpcUa_ByteString * ( ) const

Return internal OpcUa_ByteString structure.

Returns
internal OpcUa_ByteString structure.
bool UaByteString::operator!= ( const UaByteString other) const

Returns true if other is not equal to this.

See Also
operator==
Parameters
otherthe UaString to compare.
Returns
true if other is not equal to this.
bool UaByteString::operator< ( const UaByteString other) const

Is lower than operator.

This is used to sort ByteStrings e.g. to use it as key in map

Parameters
otherthe UaByteString to compare.
Returns
true if lower false if not.
void UaByteString::operator<< ( const UaByteString other)

Appends the other byte string.

This method reallocated the internal memory as needed.

Parameters
otherthe ByteString to append.
UaByteString & UaByteString::operator= ( const UaByteString other)

Assignment operator.

Parameters
otherthe ByteString to assign.
Returns
Assignment operator.
bool UaByteString::operator== ( const UaByteString other) const

Compare variables if they are similar.

Parameters
otherthe char to compare.
Returns
true if not similar false if similar.
bool UaByteString::operator> ( const UaByteString other) const

Is greater than operator.

Parameters
otherthe UaByteString to compare.
Returns
true if greater false if not.
void UaByteString::setByteString ( OpcUa_Int32  iLength,
OpcUa_Byte *  pData 
)

Set ByteString data.

Parameters
iLengththe length of the data.
pDatathe actual used data.

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