LCOV - code coverage report
Current view: top level - harness - backendmanager_brass.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_brass.cc
       2                 :            :  * @brief BackendManager subclass for brass 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_brass.h"
      24                 :            : 
      25                 :            : using namespace std;
      26                 :            : 
      27                 :            : std::string
      28                 :         29 : BackendManagerBrass::get_dbtype() const
      29                 :            : {
      30                 :         29 :     return "brass";
      31                 :            : }
      32                 :            : 
      33                 :            : string
      34                 :        206 : BackendManagerBrass::do_get_database_path(const vector<string> & files)
      35                 :            : {
      36                 :        206 :     return createdb_brass(files);
      37                 :            : }
      38                 :            : 
      39                 :            : Xapian::WritableDatabase
      40                 :        114 : BackendManagerBrass::get_writable_database(const string & name,
      41                 :            :                                            const string & file)
      42                 :            : {
      43                 :        114 :     last_wdb_name = name;
      44                 :        114 :     return getwritedb_brass(name, vector<string>(1, file));
      45                 :            : }
      46                 :            : 
      47                 :            : string
      48                 :         28 : BackendManagerBrass::get_writable_database_path(const string & name)
      49                 :            : {
      50                 :         28 :     return getwritedb_brass_path(name);
      51                 :            : }
      52                 :            : 
      53                 :            : Xapian::Database
      54                 :         18 : BackendManagerBrass::get_writable_database_as_database()
      55                 :            : {
      56                 :         18 :     return Xapian::Brass::open(".brass/" + last_wdb_name);
      57                 :            : }
      58                 :            : 
      59                 :            : Xapian::WritableDatabase
      60                 :          4 : BackendManagerBrass::get_writable_database_again()
      61                 :            : {
      62                 :          7 :     return Xapian::Brass::open(".brass/" + last_wdb_name, Xapian::DB_OPEN);
      63                 :            : }

Generated by: LCOV version 1.8