LCOV - code coverage report
Current view: top level - backends/glass - glass_check.h (source / functions) Hit Total Coverage
Test: Test Coverage for xapian-core 954b5873a738 Lines: 4 5 80.0 %
Date: 2019-06-30 05:20:33 Functions: 2 3 66.7 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /** @file glass_check.h
       2                 :            :  * @brief Btree checking
       3                 :            :  */
       4                 :            : /* Copyright 1999,2000,2001 BrightStation PLC
       5                 :            :  * Copyright 2002 Ananova Ltd
       6                 :            :  * Copyright 2002,2004,2005,2006,2008,2009,2011,2012,2013,2014 Olly Betts
       7                 :            :  * Copyright 2008 Lemur Consulting Ltd
       8                 :            :  *
       9                 :            :  * This program is free software; you can redistribute it and/or
      10                 :            :  * modify it under the terms of the GNU General Public License as
      11                 :            :  * published by the Free Software Foundation; either version 2 of the
      12                 :            :  * License, or (at your option) any later version.
      13                 :            :  *
      14                 :            :  * This program is distributed in the hope that it will be useful,
      15                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      16                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17                 :            :  * GNU General Public License for more details.
      18                 :            :  *
      19                 :            :  * You should have received a copy of the GNU General Public License
      20                 :            :  * along with this program; if not, write to the Free Software
      21                 :            :  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
      22                 :            :  * USA
      23                 :            :  */
      24                 :            : 
      25                 :            : #ifndef XAPIAN_INCLUDED_GLASS_CHECK_H
      26                 :            : #define XAPIAN_INCLUDED_GLASS_CHECK_H
      27                 :            : 
      28                 :            : #include "glass_table.h"
      29                 :            : 
      30                 :            : #include <iosfwd>
      31                 :            : #include <string>
      32                 :            : 
      33                 :            : class GlassVersion;
      34                 :            : 
      35                 :          0 : class GlassTableCheck : public GlassTable {
      36                 :            :   public:
      37                 :            :     static GlassTableCheck * check(
      38                 :            :             const char * tablename, const std::string & path, int fd,
      39                 :            :             off_t offset_,
      40                 :            :             const GlassVersion & version_file,
      41                 :            :             int opts, std::ostream *out);
      42                 :            : 
      43                 :            :   private:
      44                 :         29 :     GlassTableCheck(const char * tablename_, const std::string &path_,
      45                 :            :                     bool readonly_, std::ostream *out_)
      46                 :         29 :         : GlassTable(tablename_, path_, readonly_), out(out_) { }
      47                 :            : 
      48                 :         30 :     GlassTableCheck(const char * tablename_, int fd, off_t offset_,
      49                 :            :                     bool readonly_, std::ostream *out_)
      50                 :         30 :         : GlassTable(tablename_, fd, offset_, readonly_), out(out_) { }
      51                 :            : 
      52                 :            :     void block_check(Glass::Cursor * C_, int j, int opts,
      53                 :            :                      GlassFreeListChecker &flcheck);
      54                 :            :     int block_usage(const uint8_t * p) const;
      55                 :            :     void report_block(int m, int n, const uint8_t * p) const;
      56                 :            :     void report_block_full(int m, int n, const uint8_t * p) const;
      57                 :            :     void report_cursor(int N, const Glass::Cursor *C_) const;
      58                 :            : 
      59                 :            :     void print_key(const uint8_t * p, int c, int j) const;
      60                 :            :     void print_tag(const uint8_t * p, int c, int j) const;
      61                 :            :     void print_spaces(int n) const;
      62                 :            :     void print_bytes(int n, const uint8_t * p) const;
      63                 :            : 
      64                 :            :     std::ostream *out;
      65                 :            : };
      66                 :            : 
      67                 :            : #ifdef DISABLE_GPL_LIBXAPIAN
      68                 :            : # error GPL source we cannot relicense included in libxapian
      69                 :            : #endif
      70                 :            : 
      71                 :            : #endif /* XAPIAN_INCLUDED_GLASS_CHECK_H */

Generated by: LCOV version 1.11