blob: 3b5e90680d4b683f57c1ae2735619b9540325dc1 [file] [log] [blame]
Jeff Thompsonfa306642013-06-17 15:06:57 -07001/*
2 * File: test-no-boost.cpp
3 * Author: jefft0
4 *
5 * Created on June 10, 2013, 4:21 PM
6 */
7
8#include <cstdlib>
9#include <sstream>
Jeff Thompson29310402013-06-19 13:32:26 -070010#include <iostream>
Jeff Thompsonfa306642013-06-17 15:06:57 -070011#include "ndn-cpp/fields/name.h"
12#include "ndn-cpp/fields/name-component.h"
13#include "ndn-cpp/interest.h"
14#include "ndn-cpp/wire/ccnb.h"
15
16using namespace std;
17using namespace ndn;
18
19/*
20 *
21 */
22int main(int argc, char** argv) {
Jeff Thompson29310402013-06-19 13:32:26 -070023 ptr_lib::shared_ptr<Interest> interest(new Interest());
Jeff Thompson4454bf72013-06-18 13:33:12 -070024 interest->setName(Name("/test"));
25 interest->setMinSuffixComponents(2);
26 interest->setMaxSuffixComponents(2);
27 interest->setInterestLifetime(boost::posix_time::seconds(10));
28 interest->setScope(Interest::SCOPE_LOCAL_CCND);
29 interest->setAnswerOriginKind(Interest::AOK_STALE);
30 interest->setChildSelector(Interest::CHILD_RIGHT);
Jeff Thompsonfa306642013-06-17 15:06:57 -070031 // i.setPublisherPublicKeyDigest(?);
32 ostringstream binary;
Jeff Thompson4454bf72013-06-18 13:33:12 -070033 wire::Ccnb::appendInterest(binary, *interest);
Jeff Thompsonfa306642013-06-17 15:06:57 -070034 cout << binary.str().size();
35
36 return 0;
37}