Portuguese eID Middleware SDK  Version: 3.12.0
eIDMW::PTEID_ByteArray Class Reference

#include <eidlib.h>

Public Member Functions

PTEIDSDK_API PTEID_ByteArray ()
 
PTEIDSDK_API PTEID_ByteArray (const PTEID_ByteArray &bytearray)
 
PTEIDSDK_API PTEID_ByteArray (const unsigned char *pucData, unsigned long ulSize)
 
virtual PTEIDSDK_API ~PTEID_ByteArray ()
 
PTEIDSDK_API void Append (const unsigned char *pucData, unsigned long ulSize)
 
PTEIDSDK_API void Append (const PTEID_ByteArray &data)
 
PTEIDSDK_API void Clear ()
 
PTEIDSDK_API bool Equals (const PTEID_ByteArray &data) const
 
PTEIDSDK_API unsigned long Size () const
 
PTEIDSDK_API const unsigned char * GetBytes () const
 
const char * GetStringAt (unsigned long ulOffset, unsigned long ulLen) const
 
PTEIDSDK_API bool writeToFile (const char *csFilePath)
 
PTEIDSDK_API PTEID_ByteArrayoperator= (const PTEID_ByteArray &bytearray)
 
NOEXPORT_PTEIDSDK PTEID_ByteArray (const SDK_Context *context, const CByteArray &impl)
 
NOEXPORT_PTEIDSDK PTEID_ByteArrayoperator= (const CByteArray &bytearray)
 
- Public Member Functions inherited from eIDMW::PTEID_Object
virtual PTEIDSDK_API ~PTEID_Object ()=0
 
NOEXPORT_PTEIDSDK void Init (const SDK_Context *context, void *impl)
 
NOEXPORT_PTEIDSDK void Release ()
 

Additional Inherited Members

- Protected Member Functions inherited from eIDMW::PTEID_Object
 PTEID_Object (const SDK_Context *context, void *impl)
 
void addObject (PTEID_Object *impl)
 
void backupObject (unsigned long idx)
 
PTEID_ObjectgetObject (unsigned long idx)
 
PTEID_ObjectgetObject (void *impl)
 
void delObject (unsigned long idx)
 
void delObject (void *impl)
 
void checkContextStillOk () const
 
 PTEID_Object (const PTEID_Object &obj)
 
PTEID_Objectoperator= (const PTEID_Object &obj)
 
- Protected Attributes inherited from eIDMW::PTEID_Object
bool m_delimpl
 
void * m_impl
 
unsigned long m_ulIndexExtAdd
 
std::map< unsigned long, PTEID_Object * > m_objects
 
SDK_Context * m_context
 

Detailed Description

Class used to receive and supply an array of bytes from/to different methods in the SDK.

Memory management note - instances of this class will not own the char arrays that are supplied to it in the constructor or Append() methods as this class will perform copies of the input arrays

Constructor & Destructor Documentation

◆ PTEID_ByteArray() [1/4]

PTEIDSDK_API eIDMW::PTEID_ByteArray::PTEID_ByteArray ( )

Default constructor

◆ PTEID_ByteArray() [2/4]

PTEIDSDK_API eIDMW::PTEID_ByteArray::PTEID_ByteArray ( const PTEID_ByteArray bytearray)

Copy constructor

◆ PTEID_ByteArray() [3/4]

PTEIDSDK_API eIDMW::PTEID_ByteArray::PTEID_ByteArray ( const unsigned char *  pucData,
unsigned long  ulSize 
)

Constructor - initialize a byte array with an array of unsigned char.

Parameters
pucDatais the byte array
ulSizeis the size of the array

◆ ~PTEID_ByteArray()

virtual PTEIDSDK_API eIDMW::PTEID_ByteArray::~PTEID_ByteArray ( )
virtual

Destructor

◆ PTEID_ByteArray() [4/4]

NOEXPORT_PTEIDSDK eIDMW::PTEID_ByteArray::PTEID_ByteArray ( const SDK_Context *  context,
const CByteArray &  impl 
)

For internal use : construct from lower level object

Member Function Documentation

◆ Append() [1/2]

PTEIDSDK_API void eIDMW::PTEID_ByteArray::Append ( const unsigned char *  pucData,
unsigned long  ulSize 
)

Append data to the byte array.

Parameters
pucDatais the byte array
ulSizeis the size of the array

◆ Append() [2/2]

PTEIDSDK_API void eIDMW::PTEID_ByteArray::Append ( const PTEID_ByteArray data)

Append data to the byte array.

◆ Clear()

PTEIDSDK_API void eIDMW::PTEID_ByteArray::Clear ( )

Remove the data from the byte array.

◆ Equals()

PTEIDSDK_API bool eIDMW::PTEID_ByteArray::Equals ( const PTEID_ByteArray data) const

Return true if the content of data is the same as this.

◆ GetBytes()

PTEIDSDK_API const unsigned char* eIDMW::PTEID_ByteArray::GetBytes ( ) const

Return the array of bytes in the object. If Size() == 0, then NULL is returned.

◆ GetStringAt()

const char* eIDMW::PTEID_ByteArray::GetStringAt ( unsigned long  ulOffset,
unsigned long  ulLen 
) const

Get a string from buffer at ulOffset position and with ulLen size.

◆ operator=() [1/2]

PTEIDSDK_API PTEID_ByteArray& eIDMW::PTEID_ByteArray::operator= ( const PTEID_ByteArray bytearray)

Copy content of bytearray.

◆ operator=() [2/2]

NOEXPORT_PTEIDSDK PTEID_ByteArray& eIDMW::PTEID_ByteArray::operator= ( const CByteArray &  bytearray)

For internal use : copy from lower level object

◆ Size()

PTEIDSDK_API unsigned long eIDMW::PTEID_ByteArray::Size ( ) const

Return the number of bytes in the array.

◆ writeToFile()

PTEIDSDK_API bool eIDMW::PTEID_ByteArray::writeToFile ( const char *  csFilePath)

Writing the binary content to a file.