Jeff Thompson | 9c41dfe | 2013-06-27 12:10:25 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Author: Jeff Thompson |
| 3 | * |
| 4 | * BSD license, See the LICENSE file for more information. |
| 5 | */ |
| 6 | |
| 7 | #ifndef NDN_NAME_HPP |
| 8 | #define NDN_NAME_HPP |
| 9 | |
| 10 | #include <vector> |
| 11 | #include "common.h" |
| 12 | #include "encoding/BinaryXMLWireFormat.hpp" |
| 13 | |
| 14 | namespace ndn { |
| 15 | |
| 16 | class Name { |
| 17 | public: |
| 18 | Name(); |
| 19 | Name(const char *uri); |
| 20 | |
| 21 | void encode(std::vector<unsigned char> &output, WireFormat &wireFormat) { |
| 22 | wireFormat.encodeName(*this, output); |
| 23 | } |
| 24 | void encode(std::vector<unsigned char> &output) { |
| 25 | encode(output, BinaryXMLWireFormat::instance()); |
| 26 | } |
| 27 | void decode(std::vector<unsigned char> &input, WireFormat &wireFormat) { |
| 28 | wireFormat.decodeName(*this, input); |
| 29 | } |
| 30 | void decode(std::vector<unsigned char> &input) { |
| 31 | decode(input, BinaryXMLWireFormat::instance()); |
| 32 | } |
| 33 | |
| 34 | private: |
| 35 | std::vector<std::vector<unsigned char> > components_; |
| 36 | }; |
| 37 | |
| 38 | } |
| 39 | |
| 40 | #endif |
| 41 | |