Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

MCFTPheader Class Reference

#include <MCFTPheader.h>

Collaboration diagram for MCFTPheader:

Collaboration graph
[legend]

Public Member Functions

int author ()
MCFTPheadercopy (const MCFheader &rhs)
MCFTPheadercopy (const MCFTPheader &rhs)
string & descript ()
MCFTPid id ()
bool is_equal (const MCFTPheader &rhs)
 MCFTPheader (const MCFTPheader &rhs)
 MCFTPheader (const MCFheader &)
 MCFTPheader ()
int mcftpsizeb ()
bool operator!= (const MCFTPheader &rhs)
MCFTPheaderoperator() (const MCFTPheader &)
MCFTPheaderoperator() (const MCFheader &)
MCFTPheaderoperator() ()
MCFTPheaderoperator<< (istream &)
MCFTPheaderoperator<< (BufferBase &)
MCFTPheaderoperator= (const MCFheader &rhs)
MCFTPheaderoperator= (const MCFTPheader &rhs)
bool operator== (const MCFTPheader &rhs)
MCFTPheaderoperator>> (ostream &)
MCFTPheaderoperator>> (BufferBase &)
void read (ostream &)
void read (BufferBase &)
int release ()
void report (ostream &=cout)
int revision ()
void set_author (int author)
void set_descript (char *descript)
void set_descript (string &descript)
void set_id (MCFTPid)
void set_mcftpsizeb (int mcfsizeb)
void set_release (int release)
void set_revision (int revision)
void set_tag (char *tag)
void set_tag (string &tag)
void set_version (int version)
int sizeb ()
string & tag ()
int version ()
void write (istream &)
void write (BufferBase &)

Protected Attributes

int _author
string _descript
MCFTPid _id
int _mcftpsizeb
int _release
int _revision
string _tag
int _version

Friends

class MCFheader
ostream & operator<< (ostream &, MCFTPheader &)
BufferBaseoperator<< (BufferBase &, MCFTPheader &)
istream & operator>> (istream &, MCFTPheader &)
BufferBaseoperator>> (BufferBase &, MCFTPheader &)

Constructor & Destructor Documentation

MCFTPheader::MCFTPheader  ) 
 

Definition at line 103 of file MCFTPheader.h.

00104   : _tag("MCFTP___"), _mcftpsizeb(-1),
00105     _version(0), _revision(2), _release(0),
00106     _author(0), _descript("")
00107 {}

MCFTPheader::MCFTPheader const MCFheader  ) 
 

Definition at line 110 of file MCFTPheader.h.

00111   : _tag(rhs._tag), _mcftpsizeb(rhs._mcfsizeb),
00112     _version(rhs._version), _revision(rhs._revision), _release(rhs._release),
00113     _author(rhs._author), _descript(rhs._descript)
00114 {}

MCFTPheader::MCFTPheader const MCFTPheader rhs  ) 
 

Definition at line 117 of file MCFTPheader.h.

00118   : _tag(rhs._tag), _id(rhs._id), _mcftpsizeb(rhs._mcftpsizeb), 
00119     _version(rhs._version), _revision(rhs._revision), _release(rhs._release),
00120     _author(rhs._author), _descript(rhs._descript)
00121 {}


Member Function Documentation

int MCFTPheader::author  ) 
 

Definition at line 224 of file MCFTPheader.h.

00224 { return _author; }

MCFTPheader & MCFTPheader::copy const MCFheader rhs  ) 
 

Definition at line 75 of file MCFTPheader.cpp.

References MCFheader._author, MCFheader._descript, _id, MCFheader._mcfsizeb, _mcftpsizeb, MCFheader._release, MCFheader._revision, MCFheader._tag, and MCFheader._version.

00076 {
00077    _tag = rhs._tag;
00078    _id();
00079    _mcftpsizeb = rhs._mcfsizeb;
00080    _version = rhs._version;
00081    _revision = rhs._revision;
00082    _release = rhs._release;
00083    _author = rhs._author;
00084    _descript = rhs._descript;
00085    return *this;
00086 }

MCFTPheader & MCFTPheader::copy const MCFTPheader rhs  ) 
 

Definition at line 60 of file MCFTPheader.cpp.

References _author, _descript, _id, _mcftpsizeb, _release, _revision, _tag, and _version.

Referenced by operator=().

00061 {
00062    if ( this != &rhs ) {
00063       _tag = rhs._tag;
00064       _id = rhs._id;
00065       _mcftpsizeb = rhs._mcftpsizeb;
00066       _version = rhs._version;
00067       _revision = rhs._revision;
00068       _release = rhs._release;
00069       _author = rhs._author;
00070       _descript = rhs._descript;
00071    }
00072    return *this;
00073 }

string & MCFTPheader::descript  ) 
 

Definition at line 230 of file MCFTPheader.h.

00230 { return _descript; }

MCFTPid MCFTPheader::id  ) 
 

Definition at line 209 of file MCFTPheader.h.

References _id.

00209 { return _id; }

bool MCFTPheader::is_equal const MCFTPheader rhs  ) 
 

Definition at line 88 of file MCFTPheader.cpp.

References _author, _descript, _id, _mcftpsizeb, _release, _revision, _tag, and _version.

Referenced by operator!=(), and operator==().

00089 {
00090    if ( this != &rhs ) {
00091       if ( _tag != rhs._tag ) return false;
00092       if ( _id != rhs._id ) return false;
00093       if ( _mcftpsizeb != rhs._mcftpsizeb ) return false;
00094       if ( _version != rhs._version ) return false;
00095       if ( _revision != rhs._revision ) return false;
00096       if ( _release != rhs._release ) return false;
00097       if ( _author != rhs._author ) return false;
00098       if ( _descript != rhs._descript ) return false;
00099    }
00100    return true;
00101 }

int MCFTPheader::mcftpsizeb  ) 
 

Definition at line 212 of file MCFTPheader.h.

References _mcftpsizeb.

00212 { return _mcftpsizeb; }

bool MCFTPheader::operator!= const MCFTPheader rhs  ) 
 

Definition at line 142 of file MCFTPheader.h.

References is_equal().

00143 { 
00144    return !is_equal(rhs); 
00145 }

MCFTPheader & MCFTPheader::operator() const MCFTPheader  ) 
 

Definition at line 47 of file MCFTPheader.cpp.

References _author, _descript, _id, _mcftpsizeb, _release, _revision, _tag, and _version.

00048 {
00049    _tag = header._tag;
00050    _id = header._id;
00051    _mcftpsizeb = header._mcftpsizeb;
00052    _version = header._version;
00053    _revision = header._revision;
00054    _release = header._release;
00055    _author = header._author;
00056    _descript = header._descript;
00057    return *this;
00058 }

MCFTPheader & MCFTPheader::operator() const MCFheader  ) 
 

Definition at line 34 of file MCFTPheader.cpp.

References MCFheader._author, MCFheader._descript, _id, _mcftpsizeb, MCFheader._release, MCFheader._revision, MCFheader._tag, and MCFheader._version.

00035 {
00036    _tag = header._tag;
00037    _id();
00038    _mcftpsizeb = -1;
00039    _version = header._version;
00040    _revision = header._revision;
00041    _release = header._release;
00042    _author = header._author;
00043    _descript = header._descript;
00044    return *this;
00045 }

MCFTPheader & MCFTPheader::operator()  ) 
 

Definition at line 21 of file MCFTPheader.cpp.

References _id, and _mcftpsizeb.

00022 {
00023    _tag = "MCFTP___";
00024    _id();
00025    _mcftpsizeb = -1;
00026    _version = 0;
00027    _revision = 2;
00028    _release = 0;
00029    _author = 0;
00030    _descript = "";
00031    return *this;
00032 }

MCFTPheader & MCFTPheader::operator<< istream &   ) 
 

Definition at line 162 of file MCFTPheader.h.

References write().

00163 {
00164    write(is);
00165    return *this;
00166 }

MCFTPheader & MCFTPheader::operator<< BufferBase  ) 
 

Definition at line 148 of file MCFTPheader.h.

References write().

00149 {
00150    write(buffer);
00151    return *this;
00152 }

MCFTPheader & MCFTPheader::operator= const MCFheader rhs  ) 
 

Definition at line 130 of file MCFTPheader.h.

References copy().

00131 { 
00132    return copy(rhs); 
00133 }

MCFTPheader & MCFTPheader::operator= const MCFTPheader rhs  ) 
 

Definition at line 124 of file MCFTPheader.h.

References copy().

00125 { 
00126    return copy(rhs); 
00127 }

bool MCFTPheader::operator== const MCFTPheader rhs  ) 
 

Definition at line 136 of file MCFTPheader.h.

References is_equal().

00137 { 
00138    return is_equal(rhs); 
00139 }

MCFTPheader & MCFTPheader::operator>> ostream &   ) 
 

Definition at line 169 of file MCFTPheader.h.

References read().

00170 {
00171    read(os);
00172    return *this;
00173 }

MCFTPheader & MCFTPheader::operator>> BufferBase  ) 
 

Definition at line 155 of file MCFTPheader.h.

References read().

00156 {
00157    read(buffer);
00158    return *this;
00159 }

void MCFTPheader::read ostream &   ) 
 

Definition at line 149 of file MCFTPheader.cpp.

References _id, and _mcftpsizeb.

00150 {
00151    bytepack bp;
00152    for( int i = 0; i < 8; ++i ) os.put( _tag[i] );
00153    os << _id;
00154    os << bp( _mcftpsizeb, 4 );
00155    os << bp( _version, 1 );
00156    os << bp( _revision, 1 );
00157    os << bp( _release, 1 );
00158    os << bp( _author, 1 );
00159    os << bp( int(_descript.size()), 1 );
00160    for(unsigned int i = 0; i < _descript.size(); ++i) os.put(_descript[i]);
00161 }

void MCFTPheader::read BufferBase  ) 
 

Definition at line 119 of file MCFTPheader.cpp.

References _id, _mcftpsizeb, and BufferBase.put().

Referenced by operator<<(), and operator>>().

00120 {
00121    bytepack bp;
00122    for( int i = 0; i < 8; ++i ) buffer.put( _tag[i] );
00123    buffer << _id;
00124    buffer << bp( _mcftpsizeb, 4 );
00125    buffer << bp( _version, 1 );
00126    buffer << bp( _revision, 1 );
00127    buffer << bp( _release, 1 );
00128    buffer << bp( _author, 1 );
00129    buffer << bp( int(_descript.size()), 1 );
00130    for(unsigned int i = 0; i < _descript.size(); ++i) buffer.put(_descript[i]);
00131 }

int MCFTPheader::release  ) 
 

Definition at line 221 of file MCFTPheader.h.

00221 { return _release; }

void MCFTPheader::report ostream &  = cout  ) 
 

Definition at line 163 of file MCFTPheader.cpp.

References _id, _mcftpsizeb, and MCFTPid.report().

00164 {
00165    os << "MCFTPheader::report(){\n";
00166    os << "tag = |" << _tag << "|;\n";
00167    os << "id =\n";
00168    _id.report();
00169    os << "mcftpsizeb = " << _mcftpsizeb << '\n';
00170    os << "version = " << _version << '\n';
00171    os << "revision = " << _revision << '\n';
00172    os << "release = " << _release << '\n';
00173    os << "author = " << _author << '\n';
00174    os << "descript.size() = " << _descript.size() << '\n';
00175    os << "descript = |" << _descript << "|\n";
00176    os << "}\n";
00177 }

int MCFTPheader::revision  ) 
 

Definition at line 218 of file MCFTPheader.h.

00218 { return _revision; }

void MCFTPheader::set_author int  author  ) 
 

Definition at line 197 of file MCFTPheader.h.

00197 { _author = author; }

void MCFTPheader::set_descript char *  descript  ) 
 

Definition at line 203 of file MCFTPheader.h.

00203 { _descript = descript; }

void MCFTPheader::set_descript string &  descript  ) 
 

Definition at line 200 of file MCFTPheader.h.

00200 { _descript = descript; }

void MCFTPheader::set_id MCFTPid   ) 
 

Definition at line 182 of file MCFTPheader.h.

References _id.

00182 { _id = id; }

void MCFTPheader::set_mcftpsizeb int  mcfsizeb  ) 
 

Definition at line 185 of file MCFTPheader.h.

References _mcftpsizeb.

Referenced by MCFTPmssg.MCFTPmssg(), MCFTPmssg.mcftpsizeb(), and MCFTPmssg.read().

00185 { _mcftpsizeb = mcftpsizeb; }

void MCFTPheader::set_release int  release  ) 
 

Definition at line 194 of file MCFTPheader.h.

00194 { _release = release; }

void MCFTPheader::set_revision int  revision  ) 
 

Definition at line 191 of file MCFTPheader.h.

00191 { _revision = revision; }

void MCFTPheader::set_tag char *  tag  ) 
 

Definition at line 179 of file MCFTPheader.h.

00179 { _tag = tag; }

void MCFTPheader::set_tag string &  tag  ) 
 

Definition at line 176 of file MCFTPheader.h.

00176 { _tag = tag; }

void MCFTPheader::set_version int  version  ) 
 

Definition at line 188 of file MCFTPheader.h.

00188 { _version = version; }

int MCFTPheader::sizeb  ) 
 

Definition at line 233 of file MCFTPheader.h.

Referenced by MCFTPmssg.mcftpsizeb().

00233 { return 33 + _descript.size(); }

string & MCFTPheader::tag  ) 
 

Definition at line 206 of file MCFTPheader.h.

00206 { return _tag; }

int MCFTPheader::version  ) 
 

Definition at line 215 of file MCFTPheader.h.

00215 { return _version; }

void MCFTPheader::write istream &   ) 
 

Definition at line 133 of file MCFTPheader.cpp.

References _id, and _mcftpsizeb.

00134 {
00135    bytepack bp;
00136    _tag = "";
00137    for( int i = 0; i < 8; ++i ) _tag += is.get();
00138    is >> _id;
00139    is >> bp( 0, 4 ); _mcftpsizeb = int(bp);
00140    is >> bp( 0, 1 ); _version = int(bp);
00141    is >> bp( 0, 1 ); _revision = int(bp);
00142    is >> bp( 0, 1 ); _release = int(bp);
00143    is >> bp( 0, 1 ); _author = int(bp);
00144    is >> bp( 0, 1 ); int descriptsize = int(bp);
00145    _descript = "";
00146    for( int i = 0; i < descriptsize; ++i ) _descript += is.get();
00147 }

void MCFTPheader::write BufferBase  ) 
 

Definition at line 103 of file MCFTPheader.cpp.

References _id, _mcftpsizeb, and BufferBase.get().

Referenced by operator<<(), and operator>>().

00104 {
00105    bytepack bp;
00106    _tag = "";
00107    for( int i = 0; i < 8; ++i ) _tag += buffer.get();
00108    buffer >> _id;
00109    buffer >> bp( 0, 4 ); _mcftpsizeb = int(bp);
00110    buffer >> bp( 0, 1 ); _version = int(bp);
00111    buffer >> bp( 0, 1 ); _revision = int(bp);
00112    buffer >> bp( 0, 1 ); _release = int(bp);
00113    buffer >> bp( 0, 1 ); _author = int(bp);
00114    buffer >> bp( 0, 1 ); int descriptsize = int(bp);
00115    _descript = "";
00116    for( int i = 0; i < descriptsize; ++i ) _descript += buffer.get();
00117 }


Friends And Related Function Documentation

friend class MCFheader [friend]
 

Definition at line 90 of file MCFTPheader.h.

ostream& operator<< ostream &  os,
MCFTPheader header
[friend]
 

Definition at line 193 of file MCFTPheader.cpp.

00194 {
00195    header.read(os);
00196    return os;
00197 }

BufferBase& operator<< BufferBase buffer,
MCFTPheader header
[friend]
 

Definition at line 181 of file MCFTPheader.cpp.

00182 {
00183    header.read(buffer);
00184    return buffer;
00185 }

istream& operator>> istream &  is,
MCFTPheader header
[friend]
 

Definition at line 199 of file MCFTPheader.cpp.

00200 {
00201    header.write(is);
00202    return is;
00203 }

BufferBase& operator>> BufferBase buffer,
MCFTPheader header
[friend]
 

Definition at line 187 of file MCFTPheader.cpp.

00188 {
00189    header.write(buffer);
00190    return buffer;
00191 }


Field Documentation

int MCFTPheader._author [protected]
 

Definition at line 87 of file MCFTPheader.h.

Referenced by copy(), MCFheader.copy(), is_equal(), operator()(), and MCFheader.operator()().

string MCFTPheader._descript [protected]
 

Definition at line 88 of file MCFTPheader.h.

Referenced by copy(), MCFheader.copy(), is_equal(), operator()(), and MCFheader.operator()().

MCFTPid MCFTPheader._id [protected]
 

Definition at line 82 of file MCFTPheader.h.

Referenced by copy(), id(), is_equal(), operator()(), read(), report(), set_id(), and write().

int MCFTPheader._mcftpsizeb [protected]
 

Definition at line 83 of file MCFTPheader.h.

Referenced by copy(), MCFheader.copy(), is_equal(), mcftpsizeb(), operator()(), MCFheader.operator()(), read(), report(), set_mcftpsizeb(), and write().

int MCFTPheader._release [protected]
 

Definition at line 86 of file MCFTPheader.h.

Referenced by copy(), MCFheader.copy(), is_equal(), operator()(), and MCFheader.operator()().

int MCFTPheader._revision [protected]
 

Definition at line 85 of file MCFTPheader.h.

Referenced by copy(), MCFheader.copy(), is_equal(), operator()(), and MCFheader.operator()().

string MCFTPheader._tag [protected]
 

Definition at line 81 of file MCFTPheader.h.

Referenced by copy(), MCFheader.copy(), is_equal(), and operator()().

int MCFTPheader._version [protected]
 

Definition at line 84 of file MCFTPheader.h.

Referenced by copy(), MCFheader.copy(), is_equal(), operator()(), and MCFheader.operator()().


The documentation for this class was generated from the following files:
Generated on Mon May 31 21:41:18 2004 for SR2k4 Assembler by doxygen 1.3.6