blob: fa1afe951b59a413c49859f966eb36e947038811 [file] [log] [blame]
Jeff Thompson25b4e612013-10-10 16:03:24 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Jeff Thompson5cae5e52013-07-10 19:41:20 -07002/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07003 * Copyright (C) 2013 Regents of the University of California.
4 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
Jeff Thompson5cae5e52013-07-10 19:41:20 -07005 * See COPYING for copyright and distribution information.
6 */
7
Jeff Thompson25b4e612013-10-10 16:03:24 -07008#include <ndn-cpp/common.hpp>
9#include <ndn-cpp/data.hpp>
Jeff Thompson5cae5e52013-07-10 19:41:20 -070010
11using namespace std;
12
13namespace ndn {
14
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -080015const Block &
16Data::wireEncode() const
Jeff Thompson5cae5e52013-07-10 19:41:20 -070017{
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -080018 // size_t signedPortionBeginOffset, signedPortionEndOffset;
19 // Blob encoding = wireFormat.encodeData(*this, &signedPortionBeginOffset, &signedPortionEndOffset);
20 // SignedBlob wireEncoding = SignedBlob(encoding, signedPortionBeginOffset, signedPortionEndOffset);
Jeff Thompsonf4585af2013-09-11 14:56:59 -070021
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -080022 // if (&wireFormat == WireFormat::getDefaultWireFormat())
23 // // This is the default wire encoding.
24 // const_cast<Data*>(this)->defaultWireEncoding_ = wireEncoding;
25
26 // return wireEncoding;
27 return wire_;
28}
29
30void
31Data::wireDecode(const Block &wire)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070032{
Jeff Thompson5cae5e52013-07-10 19:41:20 -070033}
34
Jeff Thompson0050abe2013-09-17 12:50:25 -070035void
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -080036Data::wireDecode(const uint8_t* input, size_t inputLength)
Jeff Thompson5cae5e52013-07-10 19:41:20 -070037{
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -080038 // size_t signedPortionBeginOffset, signedPortionEndOffset;
39 // wireFormat.decodeData(*this, input, inputLength, &signedPortionBeginOffset, &signedPortionEndOffset);
Jeff Thompson20af0732013-09-12 17:01:45 -070040
Alexander Afanasyevfadc97d2014-01-03 13:22:10 -080041 // if (&wireFormat == WireFormat::getDefaultWireFormat())
42 // // This is the default wire encoding.
43 // defaultWireEncoding_ = SignedBlob(input, inputLength, signedPortionBeginOffset, signedPortionEndOffset);
44 // else
45 // defaultWireEncoding_ = SignedBlob();
Jeff Thompson5cae5e52013-07-10 19:41:20 -070046}
47
48}