Jeff Thompson | 3b3aabf | 2013-06-21 16:50:20 -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> |
| 10 | #include <iostream> |
| 11 | #include "ndn-cpp/interest.h" |
Jeff Thompson | 42cea3a | 2013-06-25 19:10:59 -0700 | [diff] [blame^] | 12 | #include "ndn-cpp/encoding/ccnb.h" |
Jeff Thompson | 3b3aabf | 2013-06-21 16:50:20 -0700 | [diff] [blame] | 13 | |
| 14 | using namespace std; |
| 15 | using namespace ndn; |
| 16 | |
| 17 | /* |
| 18 | * |
| 19 | */ |
| 20 | int main(int argc, char** argv) { |
| 21 | ndn::ptr_lib::shared_ptr<Interest> interest(new Interest()); |
| 22 | interest->setName(Name("/test")); |
| 23 | interest->setMinSuffixComponents(2); |
| 24 | interest->setMaxSuffixComponents(2); |
| 25 | interest->setInterestLifetime(boost::posix_time::seconds(10)); |
| 26 | interest->setScope(Interest::SCOPE_LOCAL_CCND); |
| 27 | interest->setAnswerOriginKind(Interest::AOK_STALE); |
| 28 | interest->setChildSelector(Interest::CHILD_RIGHT); |
| 29 | // i.setPublisherPublicKeyDigest(?); |
| 30 | ostringstream binary; |
| 31 | wire::Ccnb::appendInterest(binary, *interest); |
| 32 | cout << binary.str().size() << "\n"; |
| 33 | |
| 34 | return 0; |
| 35 | } |