1 | //===----------------------------------------------------------------------===// |
2 | // DuckDB |
3 | // |
4 | // duckdb/main/client_context_file_opener.hpp |
5 | // |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #pragma once |
10 | |
11 | #include "duckdb/common/file_opener.hpp" |
12 | |
13 | namespace duckdb { |
14 | |
15 | class ClientContext; |
16 | |
17 | //! ClientContext-specific FileOpener implementation. |
18 | //! This object is owned by ClientContext and never outlives it. |
19 | class ClientContextFileOpener : public FileOpener { |
20 | public: |
21 | explicit ClientContextFileOpener(ClientContext &context_p) : context(context_p) { |
22 | } |
23 | |
24 | bool TryGetCurrentSetting(const string &key, Value &result) override; |
25 | |
26 | ClientContext *TryGetClientContext() override { |
27 | return &context; |
28 | }; |
29 | |
30 | private: |
31 | ClientContext &context; |
32 | }; |
33 | |
34 | } // namespace duckdb |
35 | |