oln::utils::buffer Class Reference

Buffer used for MD5 data type abstraction. More...

#include <buffer.hh>

Collaboration diagram for oln::utils::buffer:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ntg::int_u32 value_type
 Used data type.


Public Member Functions

 buffer ()
 Initialization of data.

template<class E> void add (const E &e, bool count=true)
 Add every bits of e in data.

void push_back (bool bit, bool is_padding=false)
 Push back a bit at the end of the buffer.

ntg::int_u32 operator[] (unsigned n) const
 Return the nth word.

void append_padding ()
 Append padding bits.

void append_length ()
 Append length.

unsigned size () const
 Return the number of words.

unsigned bit_len () const
 Return the length in bits.

bool is_append_padding () const
 Tell if the buffer has already been padded.

bool is_append_length () const
 Tell if the length has already been appended.


Protected Member Functions

value_type reorder (value_type x) const
 Change order of data in a word.


Protected Attributes

unsigned char current_bit_
 Number of the current bit in the current word.

std::vector< value_typedata_
 The buffer data.

value_type len1_
 first word length

value_type len2_
 second word length

bool padding_appended_
 Status of padding.

bool length_appended_
 Status of length appending.


Static Protected Attributes

const unsigned length_ = 100

Detailed Description

Buffer used for MD5 data type abstraction.

Definition at line 38 of file buffer.hh.


Member Function Documentation

template<class E>
void oln::utils::buffer::add const E &  e,
bool  count = true
[inline]
 

Add every bits of e in data.

  • e Element to work on.
  • count Tell if you want to count e size in the buffer size.

Definition at line 167 of file buffer.hh.

void oln::utils::buffer::push_back bool  bit,
bool  is_padding = false
[inline]
 

Push back a bit at the end of the buffer.

true -> push back a 1
false -> push back a 0

  • bit Bit to push.
  • is_padding Are you adding padding bytes ?

Definition at line 181 of file buffer.hh.

buffer::value_type oln::utils::buffer::reorder value_type  x  )  const [inline, protected]
 

Change order of data in a word.

  • x Data to reorder.

Definition at line 211 of file buffer.hh.


Member Data Documentation

const unsigned oln::utils::buffer::length_ = 100 [static, protected]
 

Capacity chunk.

Definition at line 111 of file buffer.hh.


The documentation for this class was generated from the following file:
Generated on Thu Apr 15 20:17:21 2004 for Olena by doxygen 1.3.6-20040222