| 1 | #pragma once |
| 2 | |
| 3 | #include <Core/Types.h> |
| 4 | |
| 5 | namespace DB |
| 6 | { |
| 7 | class Context; |
| 8 | |
| 9 | /// Extracts information about where the format schema file is from passed context and keep it. |
| 10 | class FormatSchemaInfo |
| 11 | { |
| 12 | public: |
| 13 | FormatSchemaInfo(const String & format_schema, const String & format, bool require_message, bool is_server, const std::string & format_schema_path); |
| 14 | |
| 15 | /// Returns path to the schema file. |
| 16 | const String & schemaPath() const { return schema_path; } |
| 17 | String absoluteSchemaPath() const { return schema_directory + schema_path; } |
| 18 | |
| 19 | /// Returns directory containing the schema file. |
| 20 | const String & schemaDirectory() const { return schema_directory; } |
| 21 | |
| 22 | /// Returns name of the message type. |
| 23 | const String & messageName() const { return message_name; } |
| 24 | |
| 25 | private: |
| 26 | String schema_path; |
| 27 | String schema_directory; |
| 28 | String message_name; |
| 29 | }; |
| 30 | |
| 31 | } |
| 32 | |