Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
IReaderRegistry.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
11#include <memory>
12#include <string>
13#include <string_view>
14#include <vector>
15
16namespace correlation::readers {
17
18class BaseReader;
19
24 std::string_view extension;
25 std::string_view filename;
26};
27
33public:
34 IReaderRegistry() = default;
35 virtual ~IReaderRegistry() = default;
36
41
47 [[nodiscard]] virtual BaseReader *
49
55 [[nodiscard]] virtual BaseReader *getReaderForExtension(std::string_view extension) const = 0;
56
61 [[nodiscard]] virtual std::vector<std::string> getAllExtensions() const = 0;
62
67 [[nodiscard]] virtual const std::vector<std::unique_ptr<BaseReader>> &getReaders() const = 0;
68};
69
70} // namespace correlation::readers
Base class for all file readers.
Definition BaseReader.hpp:25
virtual const std::vector< std::unique_ptr< BaseReader > > & getReaders() const =0
Returns all registered reader instances.
virtual BaseReader * getReaderForExtension(const ReaderExtensionQuery &query) const =0
Finds a reader matching the given file extension and optional filename sniffing query.
IReaderRegistry & operator=(IReaderRegistry &&)=delete
virtual BaseReader * getReaderForExtension(std::string_view extension) const =0
Finds a reader matching the given file extension.
virtual std::vector< std::string > getAllExtensions() const =0
Returns a list of all file extensions supported by the registry.
IReaderRegistry & operator=(const IReaderRegistry &)=delete
IReaderRegistry(IReaderRegistry &&)=delete
IReaderRegistry(const IReaderRegistry &)=delete
Definition TrajectoryLoader.hpp:24
Parameters for querying a reader by extension and optional filename for content sniffing.
Definition IReaderRegistry.hpp:23
std::string_view filename
Definition IReaderRegistry.hpp:25
std::string_view extension
Definition IReaderRegistry.hpp:24