Browse Source

[trac1062] doxygen update

Jelte Jansen 13 years ago
parent
commit
2b6bcb84a1

+ 1 - 1
src/lib/datasrc/database.cc

@@ -74,7 +74,7 @@ namespace {
     // created with the given name, class, type and ttl
     // The type is checked if the rrset exists, but the
     // name is not.
-    // 
+    //
     // Then adds the given rdata to the set
     //
     // Raises a DataSourceError if the type does not

+ 7 - 1
src/lib/datasrc/database.h

@@ -75,6 +75,12 @@ public:
     /**
      * \brief Starts a new search for records of the given name in the given zone
      *
+     * The data searched by this call can be retrieved with subsequent calls to
+     * getNextRecord().
+     *
+     * \exception DataSourceError if there is a problem connecting to the
+     *                            backend database
+     *
      * \param zone_id The zone to search in, as returned by getZone()
      * \param name The name of the records to find
      */
@@ -169,7 +175,7 @@ public:
          *       target again for that, but it might also use something
          *       different. It is left in for compatibility at the moment.
          * \note options are ignored at this moment
-         * 
+         *
          * \exception DataSourceError when there is a problem reading
          *                            the data from the dabase backend.
          *                            This can be a connection, code, or

+ 5 - 4
src/lib/datasrc/sqlite3_connection.cc

@@ -351,19 +351,20 @@ SQLite3Connection::getNextRecord(std::vector<std::string>& columns) {
             columns.push_back(convertToPlainChar(sqlite3_column_text(
                                                  current_stmt, column)));
         }
-        return true;
+        return (true);
     } else if (rc == SQLITE_DONE) {
         // reached the end of matching rows
         sqlite3_reset(current_stmt);
         sqlite3_clear_bindings(current_stmt);
-        return false;
+        return (false);
     }
     sqlite3_reset(current_stmt);
     sqlite3_clear_bindings(current_stmt);
-    isc_throw(DataSourceError, "Unexpected failure in sqlite3_step");
+    isc_throw(DataSourceError,
+              "Unexpected failure in sqlite3_step (sqlite result code " << rc << ")");
 
     // Compilers might not realize isc_throw always throws
-    return false;
+    return (false);
 }
 
 }

+ 23 - 0
src/lib/datasrc/sqlite3_connection.h

@@ -88,7 +88,30 @@ public:
      *     element and the zone id in the second if it was.
      */
     virtual std::pair<bool, int> getZone(const isc::dns::Name& name) const;
+
+    /**
+     * \brief Start a new search for the given name in the given zone.
+     *
+     * This implements the searchForRecords from DatabaseConnection.
+     * This particular implementation does not raise DataSourceError.
+     *
+     * \param zone_id The zone to seach in, as returned by getZone()
+     * \param name The name to find records for
+     */
     virtual void searchForRecords(int zone_id, const std::string& name);
+
+    /**
+     * \brief Retrieve the next record from the search started with
+     *        searchForRecords
+     *
+     * This implements the getNextRecord from DatabaseConnection.
+     * See the documentation there for more information.
+     *
+     * \param columns This vector will be cleared, and the fields of the record will
+     *                be appended here as strings (in the order rdtype, ttl, sigtype,
+     *                and rdata). If there was no data, the vector is untouched.
+     * \return true if there was a next record, false if there was not
+     */
     virtual bool getNextRecord(std::vector<std::string>& columns);
 private:
     /// \brief Private database data

+ 0 - 1
src/lib/dns/tests/rdata_rrsig_unittest.cc

@@ -48,7 +48,6 @@ TEST_F(Rdata_RRSIG_Test, fromText) {
     generic::RRSIG rdata_rrsig(rrsig_txt);
     EXPECT_EQ(rrsig_txt, rdata_rrsig.toText());
     EXPECT_EQ(isc::dns::RRType::A(), rdata_rrsig.typeCovered());
-
 }
 
 TEST_F(Rdata_RRSIG_Test, badText) {