| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| * Copyright (C) 2013 Regents of the University of California. |
| * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| * See COPYING for copyright and distribution information. |
| #include <ndn-cpp/common.hpp> |
| #include <ndn-cpp/data.hpp> |
| wire_ = Block(Tlv::Data); |
| wire_.push_back(getName().wireEncode()); |
| wire_.push_back(getMetaInfo().wireEncode()); |
| wire_.push_back(content_); |
| throw Error("Requested wire format, but data packet has not been signed yet"); |
| wire_.push_back(signature_.getInfo()); |
| wire_.push_back(signature_.getValue()); |
| * Decode the input using a particular wire format and update this Data. |
| * @param input The input byte array to be decoded. |
| Data::wireDecode(const Block &wire) |
| name_.wireDecode(wire_.get(Tlv::Name)); |
| metaInfo_.wireDecode(wire_.get(Tlv::MetaInfo)); |
| content_ = wire_.get(Tlv::Content); |
| signature_.setInfo(wire_.get(Tlv::SignatureInfo)); |
| signature_.setValue(wire_.get(Tlv::SignatureValue)); |