Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

MiscUtil Namespace Reference

Misc. More...

Functions

void WordToBytes (unsigned word, byte *out)
 Converts a word to an array of bytes.
unsigned BytesToWord (const byte *bytes)
 Converts an array of four bytes into a word.
int NumBytesToHoldBits (int bits)
 Returns the number of bytes need to hold the given number of bits.
template<typename TYPE >
std::string PrintVector (const std::vector< TYPE > &v)
 Prints a vector with a space between elements.

Detailed Description

Misc.

Utilities.


Function Documentation

unsigned MiscUtil::BytesToWord ( const byte bytes  ) 

Converts an array of four bytes into a word.

Definition at line 20 of file Misc.cpp.

Referenced by DfsData::Unpack().

int MiscUtil::NumBytesToHoldBits ( int  bits  ) 

Returns the number of bytes need to hold the given number of bits.

Equal to (bits + 7)/8.

Definition at line 30 of file Misc.cpp.

template<typename TYPE >
std::string MiscUtil::PrintVector ( const std::vector< TYPE > &  v  )  [inline]

Prints a vector with a space between elements.

Definition at line 40 of file Misc.hpp.

Referenced by WolvePlayer::Search(), and WolveEngine::WolveParam().

void MiscUtil::WordToBytes ( unsigned  word,
byte out 
)

Converts a word to an array of bytes.

Definition at line 12 of file Misc.cpp.

References byte.

Referenced by DfsData::Pack().


6 Jan 2011 Doxygen 1.6.3