Browse Source

[2384] Document the use of units in TTL

Michal 'vorner' Vaner 12 years ago
parent
commit
8f2d93292a
1 changed files with 12 additions and 9 deletions
  1. 12 9
      src/lib/dns/rrttl.h

+ 12 - 9
src/lib/dns/rrttl.h

@@ -74,15 +74,18 @@ public:
     explicit RRTTL(uint32_t ttlval) : ttlval_(ttlval) {}
     /// Constructor from a string.
     ///
-    /// This version of the implementation only accepts decimal TTL values in
-    /// seconds.
-    /// In a near future version, we'll extend it so that we can accept more
-    /// convenient ones such as "2H" or "1D".
-    ///
-    /// If the given string is not recognized as a valid representation of
-    /// an RR TTL, an exception of class \c InvalidRRTTL will be thrown.
-    ///
-    /// \param ttlstr A string representation of the \c RRTTL
+    /// It accepts either a decimal number, specifying number of seconds. Or,
+    /// it can be given a sequence of numbers and units, like "2H" (meaning
+    /// two hours), "1W3D" (one week and 3 days). The allowed units are W, D,
+    /// H, M and S. They can be also specified in lower-case. No further
+    /// restrictions are checked (so they can be specified in arbitrary order
+    /// and even things like "1D1D" can be used to specify two days). The
+    /// unit at the last number can be omitted in case it is seconds.
+    ///
+    /// \param ttlstr A string representation of the \c RRTTL.
+    ///
+    /// \throw InvalidRRTTL in case the string is not recognized as valid
+    ///     TTL representation.
     explicit RRTTL(const std::string& ttlstr);
     /// Constructor from wire-format data.
     ///