MiKTeX 26.5-next
A scalable TeX distribution
Loading...
Searching...
No Matches
StreamReader.h
1/* miktex/Core/StreamReader.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(CE1273C4ECD94AE2ACFFFAB81B913AED)
25#define CE1273C4ECD94AE2ACFFFAB81B913AED
26
27#include <miktex/Core/config.h>
28
29#include <miktex/Util/PathName>
30
31#include "FileStream.h"
32
33MIKTEX_CORE_BEGIN_NAMESPACE;
34
35class StreamReader
36{
37public:
38 StreamReader() = default;
39
40public:
41 StreamReader(const StreamReader& other) = delete;
42
43public:
44 StreamReader& operator=(const StreamReader& other) = delete;
45
46public:
47 StreamReader(StreamReader&& other) = delete;
48
49public:
50 StreamReader& operator=(StreamReader&& other) = delete;
51
52public:
53 virtual MIKTEXCOREEXPORT MIKTEXTHISCALL ~StreamReader() noexcept;
54
55public:
56 MIKTEXCOREEXPORT MIKTEXTHISCALL StreamReader(const MiKTeX::Util::PathName& path);
57
58public:
59 StreamReader(bool readStdin) :
60 stream(readStdin ? stdin : nullptr)
61 {
62 }
63
64public:
65 MIKTEXCORETHISAPI(bool) ReadLine(std::string& line);
66
67public:
68 MIKTEXCORETHISAPI(void) Close();
69
70private:
71 FileStream stream;
72};
73
74MIKTEX_CORE_END_NAMESPACE;
75
76#endif
Instances of this class can be used to store path names.
Definition PathName.h:64