libscid 0.1.0
Chess applications made easy.
Loading...
Searching...
No Matches
index.h
1/*
2* Copyright (c) 1999-2002 Shane Hudson
3* Copyright (c) 2006-2009 Pascal Georges
4* Copyright (C) 2014-2016 Fulvio Benini
5
6* This file is part of Scid (Shane's Chess Information Database).
7*
8* Scid is free software: you can redistribute it and/or modify
9* it under the terms of the GNU General Public License as published by
10* the Free Software Foundation.
11*
12* Scid is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16*
17* You should have received a copy of the GNU General Public License
18* along with Scid. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef SCID_INDEX_H
22#define SCID_INDEX_H
23
24#include "scid/database/common.h"
25#include "scid/database/game_id.h"
26#include "scid/database/indexentry.h"
27#include <memory>
28
29
31// Index: Class Definition
32
33namespace scid::database {
34
35class Index
36{
37private:
38 struct Impl;
39 std::unique_ptr<Impl> impl_;
40
41public:
42 Index();
43 ~Index();
44 Index(const Index&) = delete;
45 Index& operator=(const Index&) = delete;
46
47 void Close();
48
49 const IndexEntry* GetEntry (gamenumT g) const;
50
60 int GetBadNameIdCount() const;
61
62 void setBadNameIdCount(int count);
63
67 gamenumT GetNumGames() const;
68
69 void addEntry(const IndexEntry& ie);
70
71 void replaceEntry(const IndexEntry& ie, gamenumT replaced);
72
73private:
74 void Init();
75};
76
77
78
79} // namespace scid::database
80#endif // #ifdef SCID_INDEX_H
81
83// EOF: index.h
Definition indexentry.h:51
Definition index.h:36
int GetBadNameIdCount() const
GetBadNameIdCount() - return the number of invalid name handles.
gamenumT GetNumGames() const
Header getter functions.
class StrRange - parse a string interpreting its content as 1 or 2 integers separated by whitespace.
Definition common.h:30