-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathlocaleawarestring.h
68 lines (55 loc) · 1.35 KB
/
localeawarestring.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef TAG_PARSER_LOCALEAWARESTRING_H
#define TAG_PARSER_LOCALEAWARESTRING_H
#include "./localehelper.h"
#include <string>
#include <vector>
namespace TagParser {
/*!
* \brief The LocaleAwareString class is a standard string with locale information (languages, countries).
*/
class TAG_PARSER_EXPORT LocaleAwareString : public std::string {
public:
explicit LocaleAwareString(const std::string &value = std::string());
explicit LocaleAwareString(std::string &&value);
~LocaleAwareString();
const Locale &locale() const;
Locale &locale();
private:
Locale m_locale;
};
/*!
* \brief Constructs a new LocaleAwareString from the specified standard string.
*/
inline LocaleAwareString::LocaleAwareString(const std::string &value)
: std::string(value)
{
}
/*!
* \brief Constructs a new LocaleAwareString from the specified standard string.
*/
inline LocaleAwareString::LocaleAwareString(std::string &&value)
: std::string(value)
{
}
/*!
* \brief Destroys the instance.
*/
inline LocaleAwareString::~LocaleAwareString()
{
}
/*!
* \brief Returns the associated locale.
*/
inline const Locale &LocaleAwareString::locale() const
{
return m_locale;
}
/*!
* \brief Returns the associated locale.
*/
inline Locale &LocaleAwareString::locale()
{
return m_locale;
}
} // namespace TagParser
#endif // TAG_PARSER_LOCALEAWARESTRING_H