Public Types | Public Member Functions | Public Attributes | List of all members
Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP > Struct Template Reference

#include <cel_blob.h>

Public Types

enum  
 

Public Member Functions

 Blob ()
 
 Blob (const u8 *inBin)
 
 Blob (const Blob &inBin)
 
 ~Blob ()
 
Bloboperator= (const u8 *inBin)
 
Bloboperator= (const Blob &inBin)
 
 operator const u8 * () const
 
 operator u8 * ()
 
size_t getSize () const
 
void clear ()
 
bool isAllZero () const
 
bool operator== (const Blob &inBin) const
 
bool operator!= (const Blob &inBin) const
 
bool operator<= (const Blob &inBin) const
 
bool operator< (const Blob &inBin) const
 
bool operator>= (const Blob &inBin) const
 
bool operator> (const Blob &inBin) const
 
int compare (const Blob &inBin) const
 

Public Attributes

u8 bin [SIZE_NO_WARN]
 

Detailed Description

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
struct Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >

This template defines lightweight definition for Binary-Large-Object classes.

Parameters
_SIZEThe byte size of the binary data.
NEED_SECURE_CLEANUPWhether the destructor should zero-clear the instance or not.

Member Enumeration Documentation

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
anonymous enum

The size of the Blob in bytes.

Constructor & Destructor Documentation

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::Blob ( )
inline

Initializes the binary with all-0.

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::Blob ( const u8 inBin)
inline

Initializes the binary by copying the specified data.

Parameters
inBinData to copy. The pointer should point a memory location which is longer than SIZE. Only the first SIZE bytes are copied.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::Blob ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin)
inline

Duplicates the specified blob.

Parameters
inBinA Blob instance to be duplicated.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::~Blob ( )
inline

Destructs the instance.

Member Function Documentation

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
void Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::clear ( )
inline

Fill the binary with all-0.

Referenced by Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::~Blob().

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
int Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::compare ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin) const
inline
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
size_t Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::getSize ( ) const
inline

Returns the size of binary.

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
bool Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::isAllZero ( ) const
inline

Determine whether the binary is all-0 or not.

Returns
true if all the bytes are 0; otherwise false.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator const u8 * ( ) const
inline

Implicit conversion to const u8*.

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator u8 * ( )
inline

Implicit conversion to u8*.

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
bool Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator!= ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin) const
inline

Comparison of two Blob instances.

Returns
true if not identical; otherwise false.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
bool Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator< ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin) const
inline

Comparison of two Blob instances.

Returns
true if this instance is smaller than the other; otherwise false.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
bool Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator<= ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin) const
inline

Comparison of two Blob instances.

Returns
true if this instance is smaller or equal to the other; otherwise false.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Blob& Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator= ( const u8 inBin)
inline

Duplicates the specified data.

Parameters
inBinData to copy. The pointer should point a memory location which is longer than SIZE. Only the first SIZE bytes are copied.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
Blob& Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator= ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin)
inline

Duplicates the specified blob.

Parameters
inBinA Blob instance to be duplicated.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
bool Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator== ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin) const
inline

Comparison of two Blob instances.

Returns
true if identical; otherwise false.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
bool Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator> ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin) const
inline

Comparison of two Blob instances.

Returns
true if this instance is larger than the other; otherwise false.
template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
bool Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator>= ( const Blob< _SIZE, NEED_SECURE_CLEANUP > &  inBin) const
inline

Comparison of two Blob instances.

Returns
true if this instance is larger or equal to the other; otherwise false.

Member Data Documentation

template<size_t _SIZE, bool NEED_SECURE_CLEANUP = false>
u8 Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::bin[SIZE_NO_WARN]

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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo