Namespaces | |
detail | |
Classes | |
class | Error |
Enumerations | |
enum | IoEncoding { NO_ENCODING, BASE64, HEX } |
indicates how a file or stream is encoded More... | |
Functions | |
optional< Block > | loadBlock (std::istream &is, IoEncoding encoding=BASE64) |
loads a TLV block from a stream More... | |
void | saveBlock (const Block &block, std::ostream &os, IoEncoding encoding=BASE64) |
saves a TLV block to a stream More... | |
constexpr IoEncoding | DEPRECATED (BASE_64) |
template<typename T > | |
shared_ptr< T > | load (std::istream &is, IoEncoding encoding=BASE64) |
loads a TLV element from a stream More... | |
template<typename T > | |
shared_ptr< T > | load (const std::string &filename, IoEncoding encoding=BASE64) |
loads a TLV element from a file More... | |
template<typename T > | |
void | save (const T &obj, std::ostream &os, IoEncoding encoding=BASE64) |
saves a TLV element to a stream More... | |
template<typename T > | |
void | save (const T &obj, const std::string &filename, IoEncoding encoding=BASE64) |
saves a TLV element to a file More... | |
enum ndn::io::IoEncoding |
indicates how a file or stream is encoded
Enumerator | |
---|---|
NO_ENCODING | binary without encoding |
BASE64 | base64 encoding
|
HEX | hexadecimal encoding
|
optional< Block > ndn::io::loadBlock | ( | std::istream & | is, |
IoEncoding | encoding = BASE64 |
||
) |
loads a TLV block from a stream
Definition at line 30 of file io.cpp.
References BASE64, ndn::security::transform::base64Decode(), ndn::OBufferStream::buf(), HEX, ndn::security::transform::hexDecode(), NO_ENCODING, ndn::nullopt(), ndn::security::transform::streamSink(), and ndn::security::transform::stripSpace().
Referenced by ndn::io::detail::checkInnerError(), and load().
void ndn::io::saveBlock | ( | const Block & | block, |
std::ostream & | os, | ||
IoEncoding | encoding = BASE64 |
||
) |
saves a TLV block to a stream
Error | error during saving |
Definition at line 63 of file io.cpp.
References BASE64, ndn::security::transform::base64Encode(), HEX, ndn::security::transform::hexEncode(), NO_ENCODING, ndn::Block::size(), ndn::security::transform::streamSink(), and ndn::Block::wire().
constexpr IoEncoding ndn::io::DEPRECATED | ( | BASE_64 | ) |
shared_ptr<T> ndn::io::load | ( | std::istream & | is, |
IoEncoding | encoding = BASE64 |
||
) |
loads a TLV element from a stream
T | type of TLV element; T must be WireDecodable, and must have a Error nested type |
Definition at line 100 of file io.hpp.
References loadBlock().
shared_ptr<T> ndn::io::load | ( | const std::string & | filename, |
IoEncoding | encoding = BASE64 |
||
) |
loads a TLV element from a file
Definition at line 122 of file io.hpp.
References BASE64, and saveBlock().
void ndn::io::save | ( | const T & | obj, |
std::ostream & | os, | ||
IoEncoding | encoding = BASE64 |
||
) |
saves a TLV element to a stream
T | type of TLV element; T must be WireEncodable, and must have a Error nested type |
Error | error during encoding or saving |
Definition at line 141 of file io.hpp.
References ndn::io::Error::Error(), and saveBlock().
Referenced by save().
void ndn::io::save | ( | const T & | obj, |
const std::string & | filename, | ||
IoEncoding | encoding = BASE64 |
||
) |