Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dsBCD Class Reference

#include <dsBCD.h>

List of all members.

Public Methods

 dsBCD ()
 dsBCD (dsBCD &other)
 dsBCD (long xdec)
 dsBCD (const char *xdec, size_t size)
void makeBCD (const char *xdec, size_t xsize)
void makeBCD (unsigned long xdec)
void readBCD (const char *ptr, size_t size)
void readBCD (std::istream &is, size_t bytes=(size_t)-1)
void writeBCD (std::ostream &out)
long toLong ()
void toAscii (std::ostream &out)
unsigned char * bcd ()
int size ()


Detailed Description

set of Dec to packet BCD conversion routines.

BCD addition and substraction


Constructor & Destructor Documentation

dsBCD::dsBCD  
 

Construct an object

dsBCD::dsBCD dsBCD &    other
 

Copy constructor

dsBCD::dsBCD long    xdec
 

Construct an object, make BCD from long

Parameters:
xdec value to convert

dsBCD::dsBCD const char *    xdec,
size_t    size
 

Construct an object, build BCD from ascii decimal number

Parameters:
xdec - ascii decimal number
size - size of input string


Member Function Documentation

unsigned char* dsBCD::bcd   [inline]
 

Returns:
raw pointer to BCD number

void dsBCD::makeBCD unsigned long    xdec
 

Build BCD from decimal number

Parameters:
xdec - decimal number

void dsBCD::makeBCD const char *    xdec,
size_t    xsize
 

Build BCD from ascii decimal number

Parameters:
xdec - ascii decimal number
size - size of input string

void dsBCD::readBCD std::istream &    is,
size_t    bytes = (size_t)-1
 

Read BCD from stream

Parameters:
in - stream to read from
bytes - bytes to read, if bytes = (size_t) -1 read until eof

void dsBCD::readBCD const char *    ptr,
size_t    size
 

Read BCD from byte array

Parameters:
ptr - pointer to byte array holding BCD
szie - size of array

int dsBCD::size   [inline]
 

Returns:
number of bytes accuped by BCD number

void dsBCD::toAscii std::ostream &    out
 

Convert BCD to decimal ASCII string

Parameters:
out stream to out

long dsBCD::toLong  
 

Convert BCD to long

Returns:
long value

void dsBCD::writeBCD std::ostream &    out
 

Copy BCD representation to stream

Parameters:
out stream to out


The documentation for this class was generated from the following files:
Generated on Mon May 16 18:26:59 2005 for libdms4 by doxygen1.3-rc2