LCOV - code coverage report
Current view: top level - harness - backendmanager_chert.cc (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core r Lines: 13 13 100.0 %
Date: 2011-08-21 Functions: 6 6 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /** @file backendmanager_chert.cc
       2                 :            :  * @brief BackendManager subclass for chert databases.
       3                 :            :  */
       4                 :            : /* Copyright (C) 2007,2008,2009 Olly Betts
       5                 :            :  *
       6                 :            :  * This program is free software; you can redistribute it and/or
       7                 :            :  * modify it under the terms of the GNU General Public License as
       8                 :            :  * published by the Free Software Foundation; either version 2 of the
       9                 :            :  * License, or (at your option) any later version.
      10                 :            :  *
      11                 :            :  * This program is distributed in the hope that it will be useful,
      12                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14                 :            :  * GNU General Public License for more details.
      15                 :            :  *
      16                 :            :  * You should have received a copy of the GNU General Public License
      17                 :            :  * along with this program; if not, write to the Free Software
      18                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
      19                 :            :  */
      20                 :            : 
      21                 :            : #include <config.h>
      22                 :            : 
      23                 :            : #include "backendmanager_chert.h"
      24                 :            : 
      25                 :            : using namespace std;
      26                 :            : 
      27                 :            : std::string
      28                 :         27 : BackendManagerChert::get_dbtype() const
      29                 :            : {
      30                 :         27 :     return "chert";
      31                 :            : }
      32                 :            : 
      33                 :            : string
      34                 :        250 : BackendManagerChert::do_get_database_path(const vector<string> & files)
      35                 :            : {
      36                 :        250 :     return createdb_chert(files);
      37                 :            : }
      38                 :            : 
      39                 :            : Xapian::WritableDatabase
      40                 :        114 : BackendManagerChert::get_writable_database(const string & name,
      41                 :            :                                            const string & file)
      42                 :            : {
      43                 :        114 :     last_wdb_name = name;
      44                 :        114 :     return getwritedb_chert(name, vector<string>(1, file));
      45                 :            : }
      46                 :            : 
      47                 :            : string
      48                 :         27 : BackendManagerChert::get_writable_database_path(const string & name)
      49                 :            : {
      50                 :         27 :     return getwritedb_chert_path(name);
      51                 :            : }
      52                 :            : 
      53                 :            : Xapian::Database
      54                 :         18 : BackendManagerChert::get_writable_database_as_database()
      55                 :            : {
      56                 :         18 :     return Xapian::Chert::open(".chert/" + last_wdb_name);
      57                 :            : }
      58                 :            : 
      59                 :            : Xapian::WritableDatabase
      60                 :          6 : BackendManagerChert::get_writable_database_again()
      61                 :            : {
      62                 :          9 :     return Xapian::Chert::open(".chert/" + last_wdb_name, Xapian::DB_OPEN);
      63                 :            : }

Generated by: LCOV version 1.8