C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537

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 iLength, OpcUa_Byte *pData)
 construction More...
 
 UaByteString (const UaByteArray &other)
 construction More...
 
 ~UaByteString ()
 destruction
 
void clear ()
 Clear the data of the UaByteString. More...
 
void setByteString (OpcUa_Int32 iLength, 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_ByteStringcopy () 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...
 
UaString toHex (bool bSeparateWithSpace=false) const
 Converts the byte string into a hex string. 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_ByteStringclone (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 UaByteString fromHex (const UaString &src)
 Converts a hexadecimal string representation of a byte string into a UaByteString. 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, int size=-1)
 This method decodes a BASE64 encoded string and returns the decoded data. More...
 
static int base64format (char **szInput)
 This method formats a string representation of a base64 encoded blob into a format suitable to be passed to UaByteString::base64decode. 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.
UaByteString::UaByteString ( const UaByteArray other)

construction

Parameters
otherthe UaByteArray

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,
int  size = -1 
)
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[].
int UaByteString::base64format ( char **  szInput)
static

This method formats a string representation of a base64 encoded blob into a format suitable to be passed to UaByteString::base64decode.

Parameters
szInputpointer to string representation
Returns
Returns the new length of the formated string
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.

UaByteString UaByteString::fromHex ( const UaString src)
static

Converts a hexadecimal string representation of a byte string into a UaByteString.

This string should not contain spaces and the string length must be a multiple of 2 (2 chars per byte).

Parameters
srcthe source of this operation.
Returns
If an error occurs an empty byte string is returned.
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.
UaString UaByteString::toHex ( bool  bSeparateWithSpace = false) const

Converts the byte string into a hex string.

Parameters
bSeparateWithSpaceSeparates each byte in the hex string with a space. Per default bSeparateWithSpace=false, you can use bSeparateWithSpace = true for better display.
Returns
a hex string.

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