1/*
2 * IncludeHandler.h
3 *
4 * This file is part of the XShaderCompiler project (Copyright (c) 2014-2017 by Lukas Hermanns)
5 * See "LICENSE.txt" for license information.
6 */
7
8#ifndef XSC_INCLUDE_HANDLER_H
9#define XSC_INCLUDE_HANDLER_H
10
11
12#include "Export.h"
13#include <string>
14#include <istream>
15#include <memory>
16#include <vector>
17
18
19namespace Xsc
20{
21
22
23/* ===== Public classes ===== */
24
25/**
26\brief Interface for handling new include streams.
27\remarks The default implementation will read the files from an std::ifstream.
28*/
29class XSC_EXPORT IncludeHandler
30{
31
32 public:
33
34 virtual ~IncludeHandler();
35
36 /**
37 \brief Returns an input stream for the specified filename.
38 \param[in] includeName Specifies the include filename.
39 \param[in] useSearchPathsFirst Specifies whether to first use the search paths to find the file.
40 \return Unique pointer to the new input stream.
41 */
42 virtual std::unique_ptr<std::istream> Include(const std::string& filename, bool useSearchPathsFirst);
43
44 //! List of search paths.
45 std::vector<std::string> searchPaths;
46
47};
48
49
50} // /namespace Xsc
51
52
53#endif
54
55
56
57// ================================================================================