Jeff Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 1 | /* |
| 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 Thompson | 2931040 | 2013-06-19 13:32:26 -0700 | [diff] [blame^] | 10 | #include <iostream> |
Jeff Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 11 | #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 | |
| 16 | using namespace std; |
| 17 | using namespace ndn; |
| 18 | |
| 19 | /* |
| 20 | * |
| 21 | */ |
| 22 | int main(int argc, char** argv) { |
Jeff Thompson | 2931040 | 2013-06-19 13:32:26 -0700 | [diff] [blame^] | 23 | ptr_lib::shared_ptr<Interest> interest(new Interest()); |
Jeff Thompson | 4454bf7 | 2013-06-18 13:33:12 -0700 | [diff] [blame] | 24 | 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 Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 31 | // i.setPublisherPublicKeyDigest(?); |
| 32 | ostringstream binary; |
Jeff Thompson | 4454bf7 | 2013-06-18 13:33:12 -0700 | [diff] [blame] | 33 | wire::Ccnb::appendInterest(binary, *interest); |
Jeff Thompson | fa30664 | 2013-06-17 15:06:57 -0700 | [diff] [blame] | 34 | cout << binary.str().size(); |
| 35 | |
| 36 | return 0; |
| 37 | } |