encoding: update to revision 3 of the naming conventions
Change-Id: I2e5c84762c148c4cea17db13b8ff92dd65299fce
diff --git a/docs/specs/certificate.rst b/docs/specs/certificate.rst
index 2808bc8..eed4c21 100644
--- a/docs/specs/certificate.rst
+++ b/docs/specs/certificate.rst
@@ -83,9 +83,9 @@
free-form identifier.
*Version* represents the version number of the certificate. This component is encoded
-as a VersionNameComponent, following either revision 1 (marker-based) or revision 2
+as a VersionNameComponent, following either revision 1 (marker-based) or revision 3
(type-based) of the `NDN naming conventions
-<https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/>`__.
+<https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/>`__.
For example::
diff --git a/ndn-cxx/encoding/tlv.hpp b/ndn-cxx/encoding/tlv.hpp
index 4194c19..feb77f7 100644
--- a/ndn-cxx/encoding/tlv.hpp
+++ b/ndn-cxx/encoding/tlv.hpp
@@ -97,7 +97,7 @@
NameComponentMax = 65535,
AppPrivateBlock1 = 128,
- AppPrivateBlock2 = 32767
+ AppPrivateBlock2 = 32768,
};
/** @brief TLV-TYPE numbers defined in NDN Packet Format v0.2 but not in v0.3
@@ -118,11 +118,11 @@
*/
enum : uint32_t {
KeywordNameComponent = 32,
- SegmentNameComponent = 33,
- ByteOffsetNameComponent = 34,
- VersionNameComponent = 35,
- TimestampNameComponent = 36,
- SequenceNumNameComponent = 37,
+ SegmentNameComponent = 50,
+ ByteOffsetNameComponent = 52,
+ VersionNameComponent = 54,
+ TimestampNameComponent = 56,
+ SequenceNumNameComponent = 58,
};
/** @brief SignatureType values
@@ -256,12 +256,12 @@
writeVarNumber(std::ostream& os, uint64_t number);
/**
- * @brief Read nonNegativeInteger in NDN-TLV encoding.
+ * @brief Read a NonNegativeInteger in NDN-TLV encoding.
* @tparam Iterator an iterator or pointer that dereferences to uint8_t or compatible type
*
- * @param [in] size size of the nonNegativeInteger
+ * @param [in] size size of the NonNegativeInteger
* @param [inout] begin Begin of the buffer, will be incremented to point to the first byte after
- * the read nonNegativeInteger
+ * the read NonNegativeInteger
* @param [in] end End of the buffer
*
* @throw tlv::Error number cannot be read
@@ -273,14 +273,14 @@
readNonNegativeInteger(size_t size, Iterator& begin, Iterator end);
/**
- * @brief Get the number of bytes necessary to hold the value of @p integer encoded as nonNegativeInteger.
+ * @brief Get the number of bytes necessary to hold the value of @p integer encoded as NonNegativeInteger.
*/
constexpr size_t
sizeOfNonNegativeInteger(uint64_t integer) noexcept;
/**
- * @brief Write nonNegativeInteger to the specified stream.
- * @return length of written nonNegativeInteger
+ * @brief Write a NonNegativeInteger to the specified stream.
+ * @return length of written NonNegativeInteger
*/
size_t
writeNonNegativeInteger(std::ostream& os, uint64_t integer);
@@ -490,13 +490,13 @@
readNonNegativeInteger(size_t size, Iterator& begin, Iterator end)
{
if (size != 1 && size != 2 && size != 4 && size != 8) {
- NDN_THROW(Error("Invalid length " + to_string(size) + " for nonNegativeInteger"));
+ NDN_THROW(Error("Invalid length " + to_string(size) + " for NonNegativeInteger"));
}
uint64_t number = 0;
bool isOk = detail::ReadNumber<Iterator>()(size, begin, end, number);
if (!isOk) {
- NDN_THROW(Error("Insufficient data during nonNegativeInteger parsing"));
+ NDN_THROW(Error("Insufficient data during NonNegativeInteger parsing"));
}
return number;
diff --git a/ndn-cxx/impl/name-component-types.hpp b/ndn-cxx/impl/name-component-types.hpp
index 29eed49..2ab5570 100644
--- a/ndn-cxx/impl/name-component-types.hpp
+++ b/ndn-cxx/impl/name-component-types.hpp
@@ -273,7 +273,7 @@
return ct2;
}
-/** \brief Rules for a component type holding a nonNegativeInteger value, written as
+/** \brief Rules for a component type holding a NonNegativeInteger value, written as
* a decimal number in URI representation.
*/
class DecimalComponentType final : public ComponentType
@@ -288,7 +288,7 @@
// NOTE:
// We do not override check() and ensure that the component value is a well-formed
- // nonNegativeInteger, because the application may be using the same typed component
+ // NonNegativeInteger, because the application may be using the same typed component
// with different syntax and semantics.
const char*
@@ -375,7 +375,7 @@
private:
const ComponentType m_baseType;
- std::array<const ComponentType*, 38> m_table;
+ std::array<const ComponentType*, 60> m_table;
std::unordered_map<std::string, const ComponentType*> m_uriPrefixes;
};
@@ -390,16 +390,16 @@
static const GenericNameComponentType ct8;
set(tlv::GenericNameComponent, ct8);
- static const DecimalComponentType ct33(tlv::SegmentNameComponent, "SegmentNameComponent", "seg");
- set(tlv::SegmentNameComponent, ct33);
- static const DecimalComponentType ct34(tlv::ByteOffsetNameComponent, "ByteOffsetNameComponent", "off");
- set(tlv::ByteOffsetNameComponent, ct34);
- static const DecimalComponentType ct35(tlv::VersionNameComponent, "VersionNameComponent", "v");
- set(tlv::VersionNameComponent, ct35);
- static const DecimalComponentType ct36(tlv::TimestampNameComponent, "TimestampNameComponent", "t");
- set(tlv::TimestampNameComponent, ct36);
- static const DecimalComponentType ct37(tlv::SequenceNumNameComponent, "SequenceNumNameComponent", "seq");
- set(tlv::SequenceNumNameComponent, ct37);
+ static const DecimalComponentType ct50(tlv::SegmentNameComponent, "SegmentNameComponent", "seg");
+ set(tlv::SegmentNameComponent, ct50);
+ static const DecimalComponentType ct52(tlv::ByteOffsetNameComponent, "ByteOffsetNameComponent", "off");
+ set(tlv::ByteOffsetNameComponent, ct52);
+ static const DecimalComponentType ct54(tlv::VersionNameComponent, "VersionNameComponent", "v");
+ set(tlv::VersionNameComponent, ct54);
+ static const DecimalComponentType ct56(tlv::TimestampNameComponent, "TimestampNameComponent", "t");
+ set(tlv::TimestampNameComponent, ct56);
+ static const DecimalComponentType ct58(tlv::SequenceNumNameComponent, "SequenceNumNameComponent", "seq");
+ set(tlv::SequenceNumNameComponent, ct58);
}
/** \brief Get the global ComponentTypeTable.
diff --git a/ndn-cxx/name-component.cpp b/ndn-cxx/name-component.cpp
index 786b514..d9434f0 100644
--- a/ndn-cxx/name-component.cpp
+++ b/ndn-cxx/name-component.cpp
@@ -274,7 +274,7 @@
Component::toNumber() const
{
if (!isNumber())
- NDN_THROW(Error("Name component does not have nonNegativeInteger value"));
+ NDN_THROW(Error("Name component does not have NonNegativeInteger value"));
return readNonNegativeInteger(*this);
}
@@ -284,9 +284,9 @@
{
if (!isNumberWithMarker(marker))
NDN_THROW(Error("Name component does not have the requested marker "
- "or the value is not a nonNegativeInteger"));
+ "or the value is not a NonNegativeInteger"));
- Buffer::const_iterator valueBegin = value_begin() + 1;
+ auto valueBegin = value_begin() + 1;
return tlv::readNonNegativeInteger(value_size() - 1, valueBegin, value_end());
}
@@ -326,7 +326,7 @@
NDN_THROW(Error("Not a ByteOffset component"));
}
-time::system_clock::TimePoint
+time::system_clock::time_point
Component::toTimestamp() const
{
uint64_t value = 0;
@@ -407,7 +407,7 @@
}
Component
-Component::fromTimestamp(const time::system_clock::TimePoint& timePoint)
+Component::fromTimestamp(const time::system_clock::time_point& timePoint)
{
uint64_t value = time::duration_cast<time::microseconds>(timePoint - time::getUnixEpoch()).count();
return g_conventionEncoding == Convention::MARKER ?
diff --git a/ndn-cxx/name-component.hpp b/ndn-cxx/name-component.hpp
index 6b09467..0f3aa31 100644
--- a/ndn-cxx/name-component.hpp
+++ b/ndn-cxx/name-component.hpp
@@ -47,15 +47,15 @@
};
/** @brief Identify a style of NDN Naming Conventions.
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
enum class Convention {
MARKER = 1 << 0, ///< Component markers (revision 1)
- TYPED = 1 << 1, ///< Typed name components (revision 2)
+ TYPED = 1 << 1, ///< Typed name components (revision 3)
EITHER = MARKER | TYPED,
};
-/** @brief Name component markers defined in Naming Conventions revision 1.
+/** @brief Name component markers defined in Naming Conventions revision 1 (obsolete).
* @sa https://named-data.net/publications/techreports/ndn-tr-22-ndn-memo-naming-conventions/
*/
enum : uint8_t {
@@ -282,7 +282,7 @@
public: // naming conventions
/**
- * @brief Check if the component is a nonNegativeInteger
+ * @brief Check if the component is a NonNegativeInteger
* @sa https://named-data.net/doc/NDN-packet-spec/current/tlv.html#non-negative-integer-encoding
*/
bool
@@ -290,7 +290,7 @@
/**
* @brief Check if the component is a NameComponentWithMarker per NDN naming conventions rev1
- * @sa NDN Naming Conventions revision 1:
+ * @sa NDN Naming Conventions revision 1 (obsolete)
* https://named-data.net/wp-content/uploads/2014/08/ndn-tr-22-ndn-memo-naming-conventions.pdf
*/
bool
@@ -298,41 +298,41 @@
/**
* @brief Check if the component is a version per NDN naming conventions
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
isVersion() const;
/**
* @brief Check if the component is a segment number per NDN naming conventions
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
isSegment() const;
/**
* @brief Check if the component is a byte offset per NDN naming conventions
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
isByteOffset() const;
/**
* @brief Check if the component is a timestamp per NDN naming conventions
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
isTimestamp() const;
/**
* @brief Check if the component is a sequence number per NDN naming conventions
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
bool
isSequenceNumber() const;
/**
- * @brief Interpret this name component as nonNegativeInteger
+ * @brief Interpret this name component as NonNegativeInteger
*
* @sa https://named-data.net/doc/NDN-packet-spec/current/tlv.html#non-negative-integer-encoding
*
@@ -344,7 +344,7 @@
/**
* @brief Interpret this name component as NameComponentWithMarker
*
- * @sa NDN Naming Conventions revision 1:
+ * @sa NDN Naming Conventions revision 1 (obsolete)
* https://named-data.net/wp-content/uploads/2014/08/ndn-tr-22-ndn-memo-naming-conventions.pdf
*
* @param marker 1-byte octet of the marker
@@ -358,7 +358,7 @@
/**
* @brief Interpret as version component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*
* @throw tlv::Error not a Version component interpreted by the chosen convention(s).
*/
@@ -368,7 +368,7 @@
/**
* @brief Interpret as segment number component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*
* @throw tlv::Error not a Segment component interpreted by the chosen convention(s).
*/
@@ -378,7 +378,7 @@
/**
* @brief Interpret as byte offset component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*
* @throw tlv::Error not a ByteOffset component interpreted by the chosen convention(s).
*/
@@ -388,17 +388,17 @@
/**
* @brief Interpret as timestamp component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*
* @throw tlv::Error not a Timestamp component interpreted by the chosen convention(s).
*/
- time::system_clock::TimePoint
+ time::system_clock::time_point
toTimestamp() const;
/**
* @brief Interpret as sequence number component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*
* @throw tlv::Error not a SequenceNumber component interpreted by the chosen convention(s).
*/
@@ -406,7 +406,7 @@
toSequenceNumber() const;
/**
- * @brief Create a component encoded as nonNegativeInteger
+ * @brief Create a component encoded as NonNegativeInteger
*
* @sa https://named-data.net/doc/NDN-packet-spec/current/tlv.html#non-negative-integer-encoding
*
@@ -427,7 +427,7 @@
* Marker ::= BYTE
* includedNonNegativeInteger ::= BYTE{1,2,4,8}
*
- * @sa NDN Naming Conventions revision 1:
+ * @sa NDN Naming Conventions revision 1 (obsolete)
* https://named-data.net/wp-content/uploads/2014/08/ndn-tr-22-ndn-memo-naming-conventions.pdf
*
* @param marker 1-byte marker octet
@@ -437,41 +437,41 @@
fromNumberWithMarker(uint8_t marker, uint64_t number);
/**
- * @brief Create version component using NDN naming conventions
+ * @brief Create a version component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
static Component
fromVersion(uint64_t version);
/**
- * @brief Create segment number component using NDN naming conventions
+ * @brief Create a segment number component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
static Component
fromSegment(uint64_t segmentNo);
/**
- * @brief Create byte offset component using NDN naming conventions
+ * @brief Create a byte offset component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
static Component
fromByteOffset(uint64_t offset);
/**
- * @brief Create sequence number component using NDN naming conventions
+ * @brief Create a timestamp component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
static Component
- fromTimestamp(const time::system_clock::TimePoint& timePoint);
+ fromTimestamp(const time::system_clock::time_point& timePoint);
/**
- * @brief Create sequence number component using NDN naming conventions
+ * @brief Create a sequence number component using NDN naming conventions
*
- * @sa https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/
+ * @sa https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
static Component
fromSequenceNumber(uint64_t seqNo);
diff --git a/ndn-cxx/name.cpp b/ndn-cxx/name.cpp
index 9763f25..43f9725 100644
--- a/ndn-cxx/name.cpp
+++ b/ndn-cxx/name.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2021 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -103,7 +103,7 @@
// Unescape the components.
while (iComponentStart < uri.size()) {
- size_t iComponentEnd = uri.find("/", iComponentStart);
+ size_t iComponentEnd = uri.find('/', iComponentStart);
if (iComponentEnd == std::string::npos)
iComponentEnd = uri.size();
@@ -227,13 +227,13 @@
}
Name&
-Name::appendVersion(optional<uint64_t> version)
+Name::appendVersion(const optional<uint64_t>& version)
{
return append(Component::fromVersion(version.value_or(time::toUnixTimestamp(time::system_clock::now()).count())));
}
Name&
-Name::appendTimestamp(optional<time::system_clock::TimePoint> timestamp)
+Name::appendTimestamp(const optional<time::system_clock::time_point>& timestamp)
{
return append(Component::fromTimestamp(timestamp.value_or(time::system_clock::now())));
}
diff --git a/ndn-cxx/name.hpp b/ndn-cxx/name.hpp
index 4acd323..72b6c64 100644
--- a/ndn-cxx/name.hpp
+++ b/ndn-cxx/name.hpp
@@ -375,7 +375,7 @@
Name&
append(const PartialName& name);
- /** @brief Append a component with a nonNegativeInteger
+ /** @brief Append a component with a NonNegativeInteger
* @return a reference to this name, to allow chaining
* @sa https://named-data.net/doc/NDN-packet-spec/0.3/tlv.html#non-negative-integer-encoding
*/
@@ -389,10 +389,11 @@
* @param marker 1-octet marker
* @param number the number
*
- * The component is encoded as a 1-octet marker, followed by a nonNegativeInteger.
+ * The component is encoded as a 1-octet marker, followed by a NonNegativeInteger.
*
* @return a reference to this name, to allow chaining
- * @sa NDN Naming Conventions https://named-data.net/doc/tech-memos/naming-conventions.pdf
+ * @sa NDN Naming Conventions revision 1 (obsolete)
+ * https://named-data.net/wp-content/uploads/2014/08/ndn-tr-22-ndn-memo-naming-conventions.pdf
*/
Name&
appendNumberWithMarker(uint8_t marker, uint64_t number)
@@ -400,18 +401,22 @@
return append(Component::fromNumberWithMarker(marker, number));
}
- /** @brief Append a version component
- * @param version the version number to append; if nullopt, the current UNIX time
- * in milliseconds is used
- * @return a reference to this name, to allow chaining
- * @sa NDN Naming Conventions https://named-data.net/doc/tech-memos/naming-conventions.pdf
+ /**
+ * @brief Append a version component
+ * @param version the version number to append; if nullopt, the current UNIX time
+ * in milliseconds is used
+ * @return a reference to this name, to allow chaining
+ * @sa NDN Naming Conventions
+ * https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
Name&
- appendVersion(optional<uint64_t> version = nullopt);
+ appendVersion(const optional<uint64_t>& version = nullopt);
- /** @brief Append a segment number (sequential) component
- * @return a reference to this name, to allow chaining
- * @sa NDN Naming Conventions https://named-data.net/doc/tech-memos/naming-conventions.pdf
+ /**
+ * @brief Append a segment number (sequential) component
+ * @return a reference to this name, to allow chaining
+ * @sa NDN Naming Conventions
+ * https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
Name&
appendSegment(uint64_t segmentNo)
@@ -419,9 +424,11 @@
return append(Component::fromSegment(segmentNo));
}
- /** @brief Append a byte offset component
- * @return a reference to this name, to allow chaining
- * @sa NDN Naming Conventions https://named-data.net/doc/tech-memos/naming-conventions.pdf
+ /**
+ * @brief Append a byte offset component
+ * @return a reference to this name, to allow chaining
+ * @sa NDN Naming Conventions
+ * https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
Name&
appendByteOffset(uint64_t offset)
@@ -429,17 +436,21 @@
return append(Component::fromByteOffset(offset));
}
- /** @brief Append a timestamp component
- * @param timestamp the timestamp to append; if nullopt, the current system time is used
- * @return a reference to this name, to allow chaining
- * @sa NDN Naming Conventions https://named-data.net/doc/tech-memos/naming-conventions.pdf
+ /**
+ * @brief Append a timestamp component
+ * @param timestamp the timestamp to append; if nullopt, the current system time is used
+ * @return a reference to this name, to allow chaining
+ * @sa NDN Naming Conventions
+ * https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
Name&
- appendTimestamp(optional<time::system_clock::TimePoint> timestamp = nullopt);
+ appendTimestamp(const optional<time::system_clock::time_point>& timestamp = nullopt);
- /** @brief Append a sequence number component
- * @return a reference to this name, to allow chaining
- * @sa NDN Naming Conventions https://named-data.net/doc/tech-memos/naming-conventions.pdf
+ /**
+ * @brief Append a sequence number component
+ * @return a reference to this name, to allow chaining
+ * @sa NDN Naming Conventions
+ * https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/
*/
Name&
appendSequenceNumber(uint64_t seqNo)
@@ -447,8 +458,9 @@
return append(Component::fromSequenceNumber(seqNo));
}
- /** @brief Append an ImplicitSha256Digest component.
- * @return a reference to this name, to allow chaining
+ /**
+ * @brief Append an ImplicitSha256Digest component.
+ * @return a reference to this name, to allow chaining
*/
Name&
appendImplicitSha256Digest(ConstBufferPtr digest)
@@ -456,8 +468,9 @@
return append(Component::fromImplicitSha256Digest(std::move(digest)));
}
- /** @brief Append an ImplicitSha256Digest component.
- * @return a reference to this name, to allow chaining
+ /**
+ * @brief Append an ImplicitSha256Digest component.
+ * @return a reference to this name, to allow chaining
*/
Name&
appendImplicitSha256Digest(const uint8_t* digest, size_t digestSize)
@@ -465,8 +478,9 @@
return append(Component::fromImplicitSha256Digest(digest, digestSize));
}
- /** @brief Append a ParametersSha256Digest component.
- * @return a reference to this name, to allow chaining
+ /**
+ * @brief Append a ParametersSha256Digest component.
+ * @return a reference to this name, to allow chaining
*/
Name&
appendParametersSha256Digest(ConstBufferPtr digest)
@@ -474,8 +488,9 @@
return append(Component::fromParametersSha256Digest(std::move(digest)));
}
- /** @brief Append a ParametersSha256Digest component.
- * @return a reference to this name, to allow chaining
+ /**
+ * @brief Append a ParametersSha256Digest component.
+ * @return a reference to this name, to allow chaining
*/
Name&
appendParametersSha256Digest(const uint8_t* digest, size_t digestSize)
@@ -483,8 +498,9 @@
return append(Component::fromParametersSha256Digest(digest, digestSize));
}
- /** @brief Append a placeholder for a ParametersSha256Digest component.
- * @return a reference to this name, to allow chaining
+ /**
+ * @brief Append a placeholder for a ParametersSha256Digest component.
+ * @return a reference to this name, to allow chaining
*/
Name&
appendParametersSha256DigestPlaceholder();
diff --git a/tests/unit/name-component.t.cpp b/tests/unit/name-component.t.cpp
index 06e3d25..4dc0370 100644
--- a/tests/unit/name-component.t.cpp
+++ b/tests/unit/name-component.t.cpp
@@ -138,7 +138,7 @@
static void
testDecimalComponent(uint32_t type, const std::string& uriPrefix)
{
- const Component comp(makeNonNegativeIntegerBlock(type, 42)); // TLV-VALUE is a nonNegativeInteger
+ const Component comp(makeNonNegativeIntegerBlock(type, 42)); // TLV-VALUE is a NonNegativeInteger
BOOST_CHECK_EQUAL(comp.type(), type);
BOOST_CHECK_EQUAL(comp.isNumber(), true);
const auto compUri = uriPrefix + "42";
@@ -152,7 +152,7 @@
BOOST_CHECK_EQUAL(comp, Component::fromEscapedString(to_string(type) + "=%2A"));
BOOST_CHECK_EQUAL(comp, Component::fromNumber(42, type));
- const Component comp2(Block(type, fromHex("010203"))); // TLV-VALUE is *not* a nonNegativeInteger
+ const Component comp2(Block(type, fromHex("010203"))); // TLV-VALUE is *not* a NonNegativeInteger
BOOST_CHECK_EQUAL(comp2.type(), type);
BOOST_CHECK_EQUAL(comp2.isNumber(), false);
const auto comp2Uri = to_string(type) + "=%01%02%03";
@@ -396,7 +396,7 @@
return {&Component::fromSegment,
&Component::toSegment,
&Name::appendSegment,
- Name("/33=%27%10"),
+ Name("/50=%27%10"),
10000,
&Component::isSegment};
}
@@ -413,7 +413,7 @@
return {&Component::fromByteOffset,
&Component::toByteOffset,
&Name::appendByteOffset,
- Name("/34=%00%01%86%A0"),
+ Name("/52=%00%01%86%A0"),
100000,
&Component::isByteOffset};
}
@@ -447,7 +447,7 @@
return {&Component::fromVersion,
&Component::toVersion,
[] (Name& name, auto version) -> Name& { return name.appendVersion(version); },
- Name("/35=%00%0FB%40"),
+ Name("/54=%00%0FB%40"),
1000000,
&Component::isVersion};
}
@@ -458,7 +458,7 @@
public:
using ConventionRev = ConventionMarker;
- ConventionTest<time::system_clock::TimePoint>
+ ConventionTest<time::system_clock::time_point>
operator()() const
{
return {&Component::fromTimestamp,
@@ -475,13 +475,13 @@
public:
using ConventionRev = ConventionTyped;
- ConventionTest<time::system_clock::TimePoint>
+ ConventionTest<time::system_clock::time_point>
operator()() const
{
return {&Component::fromTimestamp,
&Component::toTimestamp,
[] (Name& name, auto tp) -> Name& { return name.appendTimestamp(tp); },
- Name("/36=%00%04%7BE%E3%1B%00%00"),
+ Name("/56=%00%04%7BE%E3%1B%00%00"),
time::getUnixEpoch() + 14600_days, // 40 years
&Component::isTimestamp};
}
@@ -515,7 +515,7 @@
return {&Component::fromSequenceNumber,
&Component::toSequenceNumber,
&Name::appendSequenceNumber,
- Name("/37=%00%98%96%80"),
+ Name("/58=%00%98%96%80"),
10000000,
&Component::isSequenceNumber};
}
diff --git a/tests/unit/prefix-announcement.t.cpp b/tests/unit/prefix-announcement.t.cpp
index e7399b0..f6cad22 100644
--- a/tests/unit/prefix-announcement.t.cpp
+++ b/tests/unit/prefix-announcement.t.cpp
@@ -35,7 +35,7 @@
{
return Data(
"0678 0718 announced-name=/net/example 08036E6574 08076578616D706C65"
- " keyword-prefix-ann=20025041 version=230101 segment=210100"
+ " keyword-prefix-ann=20025041 version=360101 segment=320100"
" 1403 content-type=prefix-ann 180105"
" 1530 expire in one hour 6D040036EE80"
" validity FD00FD26 FD00FE0F323031383130333054303030303030"