#include <sdes.h>
Public Types | |
| enum | SDES_ITEM_TYPE { SDES_UNDEF = 0, SDES_CNAME = 1, SDES_NAME = 2, SDES_EMAIL = 3, SDES_PHONE = 4, SDES_LOC = 5, SDES_TOOL = 6, SDES_NOTE = 7, SDES_PRIV = 8 } |
Public Member Functions | |
| SDESItem (const char *name=NULL) | |
| SDESItem (SDES_ITEM_TYPE type, const char *content) | |
| SDESItem (const SDESItem &sdesItem) | |
| virtual | ~SDESItem () |
| SDESItem & | operator= (const SDESItem &sdesItem) |
| virtual cObject * | dup () const |
| virtual const char * | className () const |
| virtual std::string | info () |
| virtual void | writeContents (std::ostream &os) |
| virtual SDES_ITEM_TYPE | type () |
| virtual const char * | content () |
| virtual int | length () |
Protected Attributes | |
| SDES_ITEM_TYPE | _type |
| int | _length |
| const char * | _content |
|
|
This enumeration holds the types of source description items as defined in the rfc. In this implementation only SDES_UNDEF and SDES_CNAME are usable.
00042 {
00043 SDES_UNDEF = 0,
00044 SDES_CNAME = 1,
00045 SDES_NAME = 2,
00046 SDES_EMAIL = 3,
00047 SDES_PHONE = 4,
00048 SDES_LOC = 5,
00049 SDES_TOOL = 6,
00050 SDES_NOTE = 7,
00051 SDES_PRIV = 8
00052 };
|
|
|
Default constructor. 00031 : cObject(name) {
00032 _type = SDES_UNDEF;
00033 _length = 2;
00034 _content = "";
00035 };
|
|
||||||||||||
|
Constructor which sets the entry. 00038 : cObject() {
00039 _type = type;
00040 _content = content;
00041 // an sdes item requires one byte for the type field,
00042 // one byte for the length field and bytes for
00043 // the content string
00044 _length = 2 + strlen(_content);
00045 };
|
|
|
Copy constructor. 00048 : cObject() {
00049 setName(sdesItem.name());
00050 operator=(sdesItem);
00051 };
|
|
|
Destructor. 00054 {
00055 };
|
|
|
Returns the class name "SDESItem". 00072 {
00073 return "SDESItem";
00074 };
|
|
|
Returns the stored sdes string. 00096 {
00097 return opp_strdup(_content);
00098 };
|
|
|
Duplicates theis SDESItem by calling the copy constructor. 00067 {
00068 return new SDESItem(*this);
00069 };
|
|
|
Writes a short info about this SDESItem into the given string. 00077 {
00078 std::stringstream out;
00079 out << "SDESItem=" << _content;
00080 return out.str();
00081 };
|
|
|
This method returns the size of this SDESItem in bytes as it would be in the real world. 00101 {
00102 // bytes needed for this sdes item are
00103 // one byte for type, one for length
00104 // and the string
00105 return _length + 2;
00106 };
|
|
|
Assignment operator. 00058 {
00059 cObject::operator=(sdesItem);
00060 _type = sdesItem._type;
00061 _length = sdesItem._length;
00062 _content = opp_strdup(sdesItem._content);
00063 return *this;
00064 };
|
|
|
Returns the type of this sdes item. 00091 {
00092 return _type;
00093 };
|
|
|
Writes an info about this SDESItem into the give output stream. 00084 {
00085 os << "SDESItem:" << endl;
00086 os << " type = " << _type << endl;
00087 os << " content = " << _content << endl;
00088 };
|
|
|
The sdes string. |
|
|
The length of this SDESItem. |
|
|
The type of this SDESItem. |
1.4.1