This file is indexed.

/usr/include/dballe/db/v7/driver.h is in libdballe-dev 7.21-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef DBALLE_DB_V7_DRIVER_H
#define DBALLE_DB_V7_DRIVER_H

#include <dballe/core/defs.h>
#include <dballe/db/defs.h>
#include <dballe/sql/fwd.h>
#include <dballe/db/v7/state.h>
#include <dballe/db/v7/data.h>
#include <wreport/var.h>
#include <memory>
#include <functional>
#include <vector>
#include <cstdio>

namespace dballe {
namespace db {
namespace v7 {
struct QueryBuilder;
struct StationQueryBuilder;
struct DataQueryBuilder;
struct SummaryQueryBuilder;
struct Repinfo;
struct Station;
struct LevTr;

struct Driver
{
public:
    sql::Connection& connection;

    Driver(sql::Connection& connection);
    virtual ~Driver();

    /// Precompiled queries to manipulate the repinfo table
    virtual std::unique_ptr<v7::Repinfo> create_repinfo() = 0;

    /// Precompiled queries to manipulate the station table
    virtual std::unique_ptr<v7::Station> create_station() = 0;

    /// Precompiled queries to manipulate the levtr table
    virtual std::unique_ptr<v7::LevTr> create_levtr() = 0;

    /// Precompiled queries to manipulate the data table
    virtual std::unique_ptr<v7::StationData> create_station_data() = 0;

    /// Precompiled queries to manipulate the data table
    virtual std::unique_ptr<v7::Data> create_data() = 0;

    /**
     * Run a station query, iterating on the resulting stations
     */
    virtual void run_station_query(const v7::StationQueryBuilder& qb, std::function<void(int id_station, const StationDesc& station)>) = 0;

    /**
     * Run a station data query, iterating on the resulting variables
     */
    virtual void run_station_data_query(const v7::DataQueryBuilder& qb, std::function<void(int id_station, const StationDesc& station, int id_data, std::unique_ptr<wreport::Var> var)>) = 0;

    /**
     * Run a data query, iterating on the resulting variables
     */
    virtual void run_data_query(const v7::DataQueryBuilder& qb, std::function<void(int id_station, const StationDesc& station, int id_levtr, const Datetime& datetime, int id_data, std::unique_ptr<wreport::Var> var)>) = 0;

    /**
     * Run a summary query, iterating on the resulting variables
     */
    virtual void run_summary_query(const v7::SummaryQueryBuilder& qb, std::function<void(int id_station, const StationDesc& station, int id_levtr, wreport::Varcode code, const DatetimeRange& datetime, size_t size)>) = 0;

    /// Create all missing tables for a DB with the given format
    void create_tables(db::Format format);

    /// Create all missing tables for V7 databases
    virtual void create_tables_v7() = 0;

    /// Delete all existing tables for a DB with the given format
    void delete_tables(db::Format format);

    /// Delete all existing tables for V7 databases
    virtual void delete_tables_v7() = 0;

    /// Empty all tables for a DB with the given format
    void remove_all(db::Format format);

    /// Empty all tables for V7 databases, assuming that they exist, without touching the repinfo table
    virtual void remove_all_v7();

    /// Perform database cleanup/maintenance on v7 databases
    virtual void vacuum_v7() = 0;

    /// Create a Driver for this connection
    static std::unique_ptr<Driver> create(dballe::sql::Connection& conn);
};

}
}
}
#endif