xref: /haiku/src/apps/haikudepot/model/LanguageRepository.h (revision eea5774f46bba925156498abf9cb1a1165647bf7)
1 /*
2  * Copyright 2024, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef LANGUAGE_REPOSITORY_H
6 #define LANGUAGE_REPOSITORY_H
7 
8 #include <vector>
9 
10 #include "Language.h"
11 
12 
13 class LanguageRepository
14 {
15 public:
16 								LanguageRepository();
17 	virtual						~LanguageRepository();
18 
19 			void				Clear();
20 			bool				IsEmpty() const;
21 			int32				CountLanguages() const;
22 	const	LanguageRef			LanguageAtIndex(int32 index) const;
23 			void				AddLanguage(const LanguageRef& value);
24 
25 			int32				IndexOfLanguage(const char* code, const char* countryCode,
26 									const char* scriptCode) const;
27 
28 private:
29 			std::vector<LanguageRef>
30 								fLanguages;
31 };
32 
33 
34 #endif // LANGUAGE_REPOSITORY_H
35