Panda3D
Public Member Functions
HashVal Class Reference

Stores a 128-bit value that represents the hashed contents (typically MD5) of a file or buffer. More...

#include "hashVal.h"

List of all members.

Public Member Functions

 HashVal (const HashVal &copy)
string as_bin () const
 Returns the HashVal as a 16-byte binary string.
string as_dec () const
 Returns the HashVal as a string with four decimal numbers.
string as_hex () const
 Returns the HashVal as a 32-byte hexadecimal string.
int compare_to (const HashVal &other) const
void input_binary (istream &in)
 Inputs the HashVal as a binary stream of bytes in order.
void input_dec (istream &in)
 Inputs the HashVal as four unsigned decimal integers.
void input_hex (istream &in)
 Inputs the HashVal as a 32-digit hexadecimal number.
void merge_with (const HashVal &other)
 Generates a new HashVal representing the xor of this one and the other one.
bool operator!= (const HashVal &other) const
bool operator< (const HashVal &other) const
void operator= (const HashVal &copy)
bool operator== (const HashVal &other) const
void output (ostream &out) const
void output_binary (ostream &out) const
 Outputs the HashVal as a binary stream of bytes in order.
void output_dec (ostream &out) const
 Outputs the HashVal as four unsigned decimal integers.
void output_hex (ostream &out) const
 Outputs the HashVal as a 32-digit hexadecimal number.
void read_datagram (DatagramIterator &source)
void read_stream (StreamReader &source)
bool set_from_bin (const string &text)
 Sets the HashVal from a 16-byte binary string.
bool set_from_dec (const string &text)
 Sets the HashVal from a string with four decimal numbers.
bool set_from_hex (const string &text)
 Sets the HashVal from a 32-byte hexademical string.
void write_datagram (Datagram &destination) const
void write_stream (StreamWriter &destination) const

Detailed Description

Stores a 128-bit value that represents the hashed contents (typically MD5) of a file or buffer.

Definition at line 32 of file hashVal.h.


Member Function Documentation

string HashVal::as_bin ( ) const

Returns the HashVal as a 16-byte binary string.

Definition at line 169 of file hashVal.cxx.

References Datagram::get_message().

string HashVal::as_dec ( ) const

Returns the HashVal as a string with four decimal numbers.

Definition at line 116 of file hashVal.cxx.

References output_dec().

string HashVal::as_hex ( ) const

Returns the HashVal as a 32-byte hexadecimal string.

Definition at line 141 of file hashVal.cxx.

void HashVal::input_binary ( istream &  in)

Inputs the HashVal as a binary stream of bytes in order.

This is not the same order expected by read_stream().

Definition at line 101 of file hashVal.cxx.

References StreamReader::get_be_uint32().

void HashVal::input_dec ( istream &  in) [inline]

Inputs the HashVal as four unsigned decimal integers.

Definition at line 135 of file hashVal.I.

Referenced by set_from_dec().

void HashVal::input_hex ( istream &  in)

Inputs the HashVal as a 32-digit hexadecimal number.

Definition at line 46 of file hashVal.cxx.

Referenced by set_from_hex().

void HashVal::merge_with ( const HashVal other) [inline]

Generates a new HashVal representing the xor of this one and the other one.

Definition at line 111 of file hashVal.I.

void HashVal::output_binary ( ostream &  out) const

Outputs the HashVal as a binary stream of bytes in order.

This is not the same order generated by write_stream().

Definition at line 85 of file hashVal.cxx.

References StreamWriter::add_be_uint32().

void HashVal::output_dec ( ostream &  out) const [inline]

Outputs the HashVal as four unsigned decimal integers.

Definition at line 125 of file hashVal.I.

Referenced by as_dec().

void HashVal::output_hex ( ostream &  out) const

Outputs the HashVal as a 32-digit hexadecimal number.

Definition at line 31 of file hashVal.cxx.

bool HashVal::set_from_bin ( const string &  text)

Sets the HashVal from a 16-byte binary string.

Returns true if successful, false otherwise.

Definition at line 182 of file hashVal.cxx.

bool HashVal::set_from_dec ( const string &  text)

Sets the HashVal from a string with four decimal numbers.

Returns true if valid, false otherwise.

Definition at line 129 of file hashVal.cxx.

References input_dec().

bool HashVal::set_from_hex ( const string &  text)

Sets the HashVal from a 32-byte hexademical string.

Returns true if successful, false otherwise.

Definition at line 157 of file hashVal.cxx.

References input_hex().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations