Browse Source

[1062] editorial/documentation proposed updates

JINMEI Tatuya 13 years ago
parent
commit
774a56a8be

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

@@ -151,11 +151,14 @@ public:
     /**
         * \brief Returns a string identifying this dabase backend
         *
+        * The returned string is mainly intended to be used for
+        * debugging/logging purposes.
+        *
         * Any implementation is free to choose the exact string content,
         * but it is advisable to make it a name that is distinguishable
         * from the others.
         *
-        * \return the name of the dabase
+        * \return the name of the database
         */
     virtual const std::string& getDBName() const = 0;
 };

+ 6 - 1
src/lib/datasrc/sqlite3_connection.h

@@ -135,7 +135,12 @@ public:
      */
     virtual void resetSearch();
 
-    virtual const std::string& getDBName() const { return database_name_; }
+    /// The SQLite3 implementation of this method returns a string starting
+    /// with a fixed prefix of "sqlite3_" followed by the DB file name
+    /// removing any path name.  For example, for the DB file
+    /// /somewhere/in/the/system/bind10.sqlite3, this method will return
+    /// "sqlite3_bind10.sqlite3".
+    virtual const std::string& getDBName() const { return (database_name_); }
 
 private:
     /// \brief Private database data

+ 1 - 1
src/lib/datasrc/tests/database_unittest.cc

@@ -116,7 +116,7 @@ public:
     }
 
     virtual const std::string& getDBName() const {
-        return database_name_;
+        return (database_name_);
     }
 private:
     std::map<std::string, std::vector< std::vector<std::string> > > records;