MiKTeX 26.5-next
A scalable TeX distribution
Loading...
Searching...
No Matches
Fndb.h
1/* miktex/Core/Fndb.h: -*- C++ -*-
2
3 Copyright (C) 1996-2021 Christian Schenk
4
5 This file is part of the MiKTeX Core Library.
6
7 The MiKTeX Core Library is free software; you can redistribute it
8 and/or modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2, or
10 (at your option) any later version.
11
12 The MiKTeX Core Library is distributed in the hope that it will be
13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 of 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 the MiKTeX Core Library; if not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
21
22#pragma once
23
24#if !defined(BFCDDE5CC44547308426241D426A676E)
25#define BFCDDE5CC44547308426241D426A676E
26
27#include <miktex/Core/config.h>
28
29#include <string>
30#include <vector>
31
32#include <miktex/Util/PathName>
33
34MIKTEX_CORE_BEGIN_NAMESPACE;
35
36class MIKTEXNOVTABLE ICreateFndbCallback
37{
38public:
39 virtual bool MIKTEXTHISCALL ReadDirectory(const MiKTeX::Util::PathName& path, std::vector<std::string>& subDirNames, std::vector<std::string>& fileNames, std::vector<std::string>& fileNameInfos) = 0;
40
41public:
42 virtual bool MIKTEXTHISCALL OnProgress(unsigned level, const MiKTeX::Util::PathName& directory) = 0;
43};
44
45class MIKTEXNOVTABLE Fndb
46{
47public:
48 Fndb() = delete;
49
50public:
51 Fndb(const Fndb& other) = delete;
52
53public:
54 Fndb& operator=(const Fndb& other) = delete;
55
56public:
57 Fndb(Fndb&& other) = delete;
58
59public:
60 Fndb& operator= (Fndb&& other) = delete;
61
62public:
63 ~Fndb() = delete;
64
65public:
66 struct Record
67 {
69 std::string fileNameInfo;
70 };
71
72public:
73 static MIKTEXCORECEEAPI(bool) Create(const MiKTeX::Util::PathName& fndbPath, const MiKTeX::Util::PathName& rootPath, ICreateFndbCallback* callback);
74
75public:
76 static MIKTEXCORECEEAPI(bool) Create(const MiKTeX::Util::PathName& fndbPath, const MiKTeX::Util::PathName& rootPath, ICreateFndbCallback* callback, bool enableStringPooling, bool storeFileNameInfo);
77
78public:
79 static MIKTEXCORECEEAPI(bool) Search(const MiKTeX::Util::PathName& fileName, const std::string& pathPattern, bool all, std::vector<Record>& result);
80
81public:
82 static MIKTEXCORECEEAPI(void) Add(const std::vector<Record>& records);
83
84public:
85 static MIKTEXCORECEEAPI(void) Remove(const std::vector<MiKTeX::Util::PathName>& paths);
86
87public:
88 static MIKTEXCORECEEAPI(bool) FileExists(const MiKTeX::Util::PathName& path);
89
90public:
91 static MIKTEXCORECEEAPI(bool) Refresh(const MiKTeX::Util::PathName& path, ICreateFndbCallback* callback);
92
93public:
94 static MIKTEXCORECEEAPI(bool) Refresh(ICreateFndbCallback* callback);
95
96};
97
98MIKTEX_CORE_END_NAMESPACE;
99
100#endif
Instances of this class can be used to store path names.
Definition PathName.h:64
Definition Fndb.h:67