1#pragma once
2
3#include <memory>
4#include "Entries.h"
5
6
7// Iterates over all name entries in data source
8class ILanguageRegionsNamesReader
9{
10public:
11 virtual bool readNext(RegionNameEntry & entry) = 0;
12
13 virtual ~ILanguageRegionsNamesReader() {}
14};
15
16using ILanguageRegionsNamesReaderPtr = std::unique_ptr<ILanguageRegionsNamesReader>;
17
18
19// Regions names data source for one language
20class ILanguageRegionsNamesDataSource
21{
22public:
23 // data modified since last createReader invocation
24 virtual bool isModified() const = 0;
25
26 // Upper bound on total length of all names
27 virtual size_t estimateTotalSize() const = 0;
28
29 virtual ILanguageRegionsNamesReaderPtr createReader() = 0;
30
31 virtual std::string getLanguage() const = 0;
32
33 virtual std::string getSourceName() const = 0;
34
35 virtual ~ILanguageRegionsNamesDataSource() {}
36};
37
38using ILanguageRegionsNamesDataSourcePtr = std::unique_ptr<ILanguageRegionsNamesDataSource>;
39
40
41// Provides regions names data sources for different languages
42class IRegionsNamesDataProvider
43{
44public:
45 /// Returns nullptr if the language data does not exist.
46 virtual ILanguageRegionsNamesDataSourcePtr getLanguageRegionsNamesSource(const std::string & language) const = 0;
47
48 virtual ~IRegionsNamesDataProvider() {}
49};
50
51using IRegionsNamesDataProviderPtr = std::unique_ptr<IRegionsNamesDataProvider>;
52