LCOV - code coverage report
Current view: top level - tests/harness - backendmanager_honey.h (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core 954b5873a738 Lines: 3 3 100.0 %
Date: 2019-06-30 05:20:33 Functions: 2 2 100.0 %
Branches: 2 4 50.0 %

           Branch data     Line data    Source code
       1                 :            : /** @file backendmanager_honey.h
       2                 :            :  * @brief BackendManager subclass for honey databases.
       3                 :            :  */
       4                 :            : /* Copyright (C) 2007,2008,2009,2017 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                 :            : #ifndef XAPIAN_INCLUDED_BACKENDMANAGER_HONEY_H
      22                 :            : #define XAPIAN_INCLUDED_BACKENDMANAGER_HONEY_H
      23                 :            : 
      24                 :            : #include "backendmanager.h"
      25                 :            : 
      26                 :            : #include <string>
      27                 :            : 
      28                 :            : #include <xapian/database.h>
      29                 :            : #include <xapian/types.h>
      30                 :            : 
      31                 :            : /// BackendManager subclass for honey databases.
      32         [ -  + ]:          2 : class BackendManagerHoney : public BackendManager {
      33                 :            :     /// Don't allow assignment.
      34                 :            :     void operator=(const BackendManagerHoney &);
      35                 :            : 
      36                 :            :     /// Don't allow copying.
      37                 :            :     BackendManagerHoney(const BackendManagerHoney &);
      38                 :            : 
      39                 :            :     /// The path of the last writable database used.
      40                 :            :     std::string last_wdb_name;
      41                 :            : 
      42                 :            :     /// BackendManager for generated testcases
      43                 :            :     BackendManager* generated_sub_manager;
      44                 :            : 
      45                 :            :   protected:
      46                 :            :     /// Get the path of Honey Xapian::Database instance.
      47                 :            :     std::string do_get_database_path(const std::vector<std::string> & files);
      48                 :            : 
      49                 :            :   public:
      50                 :            :     BackendManagerHoney(const std::string& datadir_)
      51                 :            :         : BackendManager(datadir_),
      52                 :            :           generated_sub_manager(NULL) { }
      53                 :            : 
      54                 :          1 :     BackendManagerHoney(const std::string& datadir_,
      55                 :            :                         BackendManager* generated_sub_manager_)
      56                 :            :         : BackendManager(datadir_),
      57         [ +  - ]:          1 :           generated_sub_manager(generated_sub_manager_) { }
      58                 :            : 
      59                 :            :     /// Return a string representing the current database type.
      60                 :            :     std::string get_dbtype() const;
      61                 :            : 
      62                 :            :     /// Get generated database for honey
      63                 :            :     Xapian::WritableDatabase get_generated_database(const std::string& name);
      64                 :            : 
      65                 :            :     /// Finalise generated database
      66                 :            :     void finalise_generated_database(const std::string& name);
      67                 :            : 
      68                 :            :     /// Create a Xapian::WritableDatabase object.
      69                 :            :     Xapian::WritableDatabase get_writable_database(const std::string& name,
      70                 :            :                                                    const std::string& file);
      71                 :            : 
      72                 :            :     std::string get_generated_database_path(const std::string& name);
      73                 :            : 
      74                 :            :     std::string get_compaction_output_path(const std::string& name);
      75                 :            : };
      76                 :            : 
      77                 :            : #endif // XAPIAN_INCLUDED_BACKENDMANAGER_HONEY_H

Generated by: LCOV version 1.11