MiKTeX 23.10-next
A scalable TeX distribution
Loading...
Searching...
No Matches
DirectoryLister.h
1/* miktex/Core/DirectoryLister.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(DE9EC6DA9018481D82C6DF5E08822CE3)
25#define DE9EC6DA9018481D82C6DF5E08822CE3
26
27#include <miktex/Core/config.h>
28
29#include <cstddef>
30#include <memory>
31#include <string>
32
33#include <miktex/Util/PathName>
34
35MIKTEX_CORE_BEGIN_NAMESPACE;
36
39{
41 std::string name;
42#if defined(MIKTEX_WINDOWS)
44 std::wstring wname;
45#endif
48};
49
52 public DirectoryEntry
53{
55 std::size_t size;
56};
57
59class MIKTEXNOVTABLE DirectoryLister
60{
62public:
63 enum class Options :
64 int
65 {
66 None,
68 DirectoriesOnly = 1,
70 FilesOnly = 2,
72 IncludeDotAndDotDot = 4
73 };
74
75public:
76 virtual MIKTEXTHISCALL ~DirectoryLister() noexcept = 0;
77
79public:
80 virtual void MIKTEXTHISCALL Close() = 0;
81
86public:
87 virtual bool MIKTEXTHISCALL GetNext(DirectoryEntry& direntry) = 0;
88
93public:
94 virtual bool MIKTEXTHISCALL GetNext(DirectoryEntry2& direntry2) = 0;
95
99public:
100 static MIKTEXCORECEEAPI(std::unique_ptr<DirectoryLister>) Open(const MiKTeX::Util::PathName& directory);
101
106public:
107 static MIKTEXCORECEEAPI(std::unique_ptr<DirectoryLister>) Open(const MiKTeX::Util::PathName& directory, const char* pattern);
108
114public:
115 static MIKTEXCORECEEAPI(std::unique_ptr<DirectoryLister>) Open(const MiKTeX::Util::PathName& directory, const char* pattern, int options);
116};
117
118MIKTEX_CORE_END_NAMESPACE;
119
120#endif
An instances can be used to read entries of a file system directory.
Definition: DirectoryLister.h:60
Options
Read options.
Definition: DirectoryLister.h:65
Extended directory entry information.
Definition: DirectoryLister.h:53
std::size_t size
The size (in bytes) of the file.
Definition: DirectoryLister.h:55
Directory entry information.
Definition: DirectoryLister.h:39
std::wstring wname
Native (Unicode) name of the entry.
Definition: DirectoryLister.h:44
bool isDirectory
Indicates whether the entry is a directory.
Definition: DirectoryLister.h:47
std::string name
Name of the entry.
Definition: DirectoryLister.h:41