Tag Parser  6.2.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
localeawarestring.h
Go to the documentation of this file.
1 #ifndef MEDIA_LOCALEAWARESTRING_H
2 #define MEDIA_LOCALEAWARESTRING_H
3 
4 #include "./global.h"
5 
6 #include <string>
7 #include <vector>
8 
9 namespace Media {
10 
14 class TAG_PARSER_EXPORT LocaleAwareString : public std::string
15 {
16 public:
17  LocaleAwareString(const std::string &value = std::string());
18  LocaleAwareString(std::string &&value);
20 
21  const std::vector<std::string> &languages() const;
22  std::vector<std::string> &languages();
23  const std::vector<std::string> &countries() const;
24  std::vector<std::string> &countries();
25 
26 private:
27  std::vector<std::string> m_languages;
28  std::vector<std::string> m_countries;
29 };
30 
34 inline LocaleAwareString::LocaleAwareString(const std::string &value) :
35  std::string(value)
36 {}
37 
41 inline LocaleAwareString::LocaleAwareString(std::string &&value) :
42  std::string(value)
43 {}
44 
49 {}
50 
54 inline const std::vector<std::string> &LocaleAwareString::languages() const
55 {
56  return m_languages;
57 }
58 
62 inline std::vector<std::string> &LocaleAwareString::languages()
63 {
64  return m_languages;
65 }
66 
70 inline const std::vector<std::string> &LocaleAwareString::countries() const
71 {
72  return m_countries;
73 }
74 
78 inline std::vector<std::string> &LocaleAwareString::countries()
79 {
80  return m_countries;
81 }
82 
83 } // namespace Media
84 
85 #endif // MEDIA_LOCALEAWARESTRING_H
~LocaleAwareString()
Destroys the instance.
STL namespace.
The LocaleAwareString class is a standard string with locale information (languages, countries).
LocaleAwareString(const std::string &value=std::string())
Constructs a new LocaleAwareString from the specified standard string.
const std::vector< std::string > & countries() const
Returns associated countries.
const std::vector< std::string > & languages() const
Returns associated languages.
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.