Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP > Struct Template Reference

#include <cel_blob.h>

List of all members.

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:
_SIZE The byte size of the binary data.
NEED_SECURE_CLEANUP Whether the destructor should zero-clear the instance or not.

Definition at line 27 of file cel_blob.h.


Member Enumeration Documentation

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

The size of the Blob in bytes.

Definition at line 32 of file cel_blob.h.


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.

Definition at line 45 of file cel_blob.h.

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:
inBin Data to copy. The pointer should point a memory location which is longer than SIZE. Only the first SIZE bytes are copied.

Definition at line 58 of file cel_blob.h.

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:
inBin A Blob instance to be duplicated.

Definition at line 69 of file cel_blob.h.

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

Destructs the instance.

Definition at line 78 of file cel_blob.h.


Member Function Documentation

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:
inBin Data to copy. The pointer should point a memory location which is longer than SIZE. Only the first SIZE bytes are copied.

Definition at line 92 of file cel_blob.h.

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:
inBin A Blob instance to be duplicated.

Definition at line 104 of file cel_blob.h.

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*.

Definition at line 114 of file cel_blob.h.

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

Implicit conversion to u8*.

Definition at line 122 of file cel_blob.h.

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.

Definition at line 130 of file cel_blob.h.

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

Fill the binary with all-0.

Definition at line 138 of file cel_blob.h.

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

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.

Definition at line 149 of file cel_blob.h.

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.

Definition at line 162 of file cel_blob.h.

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.

Definition at line 172 of file cel_blob.h.

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.

Definition at line 183 of file cel_blob.h.

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.

Definition at line 194 of file cel_blob.h.

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.

Definition at line 205 of file cel_blob.h.

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.

Definition at line 216 of file cel_blob.h.

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]

Comparison of two Blob instances.

Returns:
0 if both instances are identical. Negative value if this instance is smaller than the other.
Positive value if this instance is larger than the other.

Definition at line 228 of file cel_blob.h.

Referenced by Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator!=(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator<(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator<=(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator==(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator>(), and Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator>=().


Member Data Documentation

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

The binary.

Definition at line 40 of file cel_blob.h.

Referenced by Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::Blob(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::clear(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::compare(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::isAllZero(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator const u8 *(), Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator u8 *(), and Celartem::Blob< _SIZE, NEED_SECURE_CLEANUP >::operator=().


The documentation for this struct was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:13 2008.