Public Member Functions | Static Public Member Functions | List of all members
ndn::DerNode::DerGeneralizedTime Class Reference

A DerGeneralizedTime extends DerNode to represent a date and time, with millisecond accuracy. More...

#include <der-node.hpp>

Inheritance diagram for ndn::DerNode::DerGeneralizedTime:
ndn::DerNode

Public Member Functions

 DerGeneralizedTime (MillisecondsSince1970 msSince1970)
 Create a DerGeneralizedTime with the given milliseconds since 1970. More...
 
MillisecondsSince1970 toMillisecondsSince1970 ()
 Interpret the result of toVal() as a time string and return the milliseconds since 1970. More...
 
- Public Member Functions inherited from ndn::DerNode
virtual size_t getSize ()
 
virtual Blob encode ()
 Get the raw data encoding for this node. More...
 
virtual Blob toVal ()
 Convert the encoded data to a standard representation. More...
 
Blob getPayload ()
 Get a copy of the payload bytes. More...
 
virtual const std::vector< ptr_lib::shared_ptr< DerNode > > & getChildren ()
 If this object is a DerSequence, get the children of this node. More...
 

Static Public Member Functions

static std::string toIsoString (const MillisecondsSince1970 &time)
 Convert to the ISO string representation of the time. More...
 
static MillisecondsSince1970 fromIsoString (const std::string &isoString)
 Convert from the ISO string representation to the internal time format. More...
 
- Static Public Member Functions inherited from ndn::DerNode
static ptr_lib::shared_ptr< DerNodeparse (const uint8_t *inputBuf, size_t startIdx=0)
 Parse the data from the input buffer recursively and return the root as an object of a subclass of DerNode. More...
 
static DerNode::DerSequencegetSequence (const std::vector< ptr_lib::shared_ptr< DerNode > > &children, size_t index)
 Check that index is in bounds for the children list, cast children[index] to DerSequence and return it. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ndn::DerNode
 DerNode (DerNodeType nodeType)
 Create a generic DER node with the given nodeType. More...
 
void encodeHeader (size_t size)
 Encode the given size and update the header. More...
 
size_t decodeHeader (const uint8_t *inputBuf, size_t startIdx)
 Extract the header from an input buffer and return the size. More...
 
virtual void decode (const uint8_t *inputBuf, size_t startIdx)
 Decode and store the data from an input buffer. More...
 
void payloadAppend (const uint8_t *value, size_t valueLength)
 Call payload_.copy to copy value into payload_ at payloadPosition_. More...
 
- Protected Attributes inherited from ndn::DerNode
DerStructureparent_
 
DerNodeType nodeType_
 
std::vector< uint8_t > header_
 
DynamicUInt8Vector payload_
 
size_t payloadPosition_
 

Detailed Description

A DerGeneralizedTime extends DerNode to represent a date and time, with millisecond accuracy.

Constructor & Destructor Documentation

Create a DerGeneralizedTime with the given milliseconds since 1970.

Parameters
msSince1970The timestamp as milliseconds since Jan 1, 1970.

Member Function Documentation

MillisecondsSince1970 ndn::DerNode::DerGeneralizedTime::fromIsoString ( const std::string &  isoString)
static

Convert from the ISO string representation to the internal time format.

Parameters
isoStringThe ISO time formatted string.
Returns
The time in milliseconds since 1/1/1970.
string ndn::DerNode::DerGeneralizedTime::toIsoString ( const MillisecondsSince1970 time)
static

Convert to the ISO string representation of the time.

Parameters
timeMilliseconds since 1/1/1970.
Returns
The ISO string.
MillisecondsSince1970 ndn::DerNode::DerGeneralizedTime::toMillisecondsSince1970 ( )

Interpret the result of toVal() as a time string and return the milliseconds since 1970.

Returns
The timestamp value as milliseconds since 1970.

The documentation for this class was generated from the following files: