#include <tag.h>
Public Member Functions | |
| Tag (std::istream &i) | |
| Construct and load from input stream. | |
| std::string | dump (bool data=true) const |
| Generate a debugging string from this tag's contents. | |
Construct using opcode (or name) and value. Only string and | |
integer data types are allowed for construction. | |
| Tag (uint8_t opcode, const std::string &value) | |
| Tag (uint8_t opcode, uint32_t value) | |
| Tag (const std::string &name, const std::string &value) | |
| Tag (const std::string &name, uint32_t value) | |
Accessors for preconstructed or preloaded Tag data. | |
| uint32_t | getInt () const |
| float | getFloat () const |
| std::string | getStr () const |
| uint8_t | getOpcode () const |
| std::string | getName () const |
| uint8_t | getValueType () const |
Private Types | |
| enum | ValueTypes { TT_HASH = 0x01, TT_STRING = 0x02, TT_UINT32 = 0x03, TT_FLOAT = 0x04, TT_BOOL = 0x05, TT_BOOLARR = 0x06, TT_BLOB = 0x07, TT_UINT16 = 0x08, TT_UINT8 = 0x09, TT_BSOB = 0x0a } |
| Different tag value types used in the protocol. More... | |
Private Member Functions | |
| Tag () | |
| Default constructor protected. | |
Private Attributes | |
| uint8_t | m_opcode |
| Opcode. | |
| std::string | m_name |
| Name (in case of string-tag). | |
| boost::any | m_value |
| Value. | |
| uint8_t | m_valueType |
| Type of value, one of ValueTypes. | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, const Tag &t) |
| Writes ed2k-compatible tag structure to specified output stream. | |
| void | warnUnHandled (const std::string &loc, const Tag &t) |
| Small helper function to localize the warning messages on unhandled tags found while parsing. | |
A tag has its identifier (either 8-bit opcode or string value), and a data field. Refer to eDonkey2000 protocol tag system overview for detailed information on the Tag parsing system.
Definition at line 44 of file tag.h.
|
|
Different tag value types used in the protocol.
|
|
|
Construct and load from input stream.
Definition at line 27 of file tag.cpp. References dump(), m_name, m_opcode, m_value, m_valueType, TRACE_TAG(), TT_BLOB, TT_BOOL, TT_BOOLARR, TT_FLOAT, TT_HASH, TT_STRING, TT_UINT16, TT_UINT32, and TT_UINT8. |
|
||||||||||||
|
Definition at line 59 of file tag.h. References m_opcode, m_value, m_valueType, and TT_STRING. |
|
||||||||||||
|
Definition at line 61 of file tag.h. References m_opcode, m_value, m_valueType, and TT_UINT32. |
|
||||||||||||
|
Definition at line 63 of file tag.h. References m_name, m_opcode, m_value, m_valueType, and TT_STRING. |
|
||||||||||||
|
Definition at line 65 of file tag.h. References m_name, m_opcode, m_value, m_valueType, and TT_UINT32. |
|
|
Default constructor protected.
|
|
|
Definition at line 73 of file tag.h. References m_value. Referenced by dump(), ED2KPacket::Hello::load(), ED2KPacket::MuleInfo::MuleInfo(), ED2KPacket::SearchResult::SearchResult(), and Detail::Server::Server(). |
|
|
Definition at line 83 of file tag.h. References m_value. Referenced by dump(). |
|
|
Definition at line 93 of file tag.h. References m_value. Referenced by dump(), ED2KPacket::Hello::load(), ED2KPacket::MuleInfo::MuleInfo(), ED2KPacket::SearchResult::SearchResult(), Detail::Server::Server(), and ED2KPacket::ServerIdent::ServerIdent(). |
|
|
Definition at line 103 of file tag.h. References m_opcode. Referenced by ED2KPacket::Hello::load(), ED2KPacket::MuleInfo::MuleInfo(), ED2KPacket::SearchResult::SearchResult(), Detail::Server::Server(), and ED2KPacket::ServerIdent::ServerIdent(). |
|
|
Definition at line 104 of file tag.h. References m_name. Referenced by Detail::Server::Server(). |
|
|
Definition at line 105 of file tag.h. References m_valueType. |
|
|
Generate a debugging string from this tag's contents.
Definition at line 149 of file tag.cpp. References getFloat(), getInt(), getStr(), m_name, m_opcode, m_valueType, TT_FLOAT, TT_STRING, TT_UINT16, TT_UINT32, and TT_UINT8. Referenced by ED2KPacket::Hello::load(), and Tag(). |
|
||||||||||||
|
Writes ed2k-compatible tag structure to specified output stream.
|
|
||||||||||||
|
Small helper function to localize the warning messages on unhandled tags found while parsing.
|
|
|
Opcode.
Definition at line 118 of file tag.h. Referenced by dump(), getOpcode(), and Tag(). |
|
|
Name (in case of string-tag).
|
|
|
Value.
Definition at line 120 of file tag.h. Referenced by getFloat(), getInt(), getStr(), and Tag(). |
|
|
Type of value, one of ValueTypes.
Definition at line 121 of file tag.h. Referenced by dump(), getValueType(), and Tag(). |