2000-03-10 13:52:19 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
#ifndef LANGUAGE_H
|
|
|
|
#define LANGUAGE_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include "LString.h"
|
|
|
|
|
2000-07-04 20:32:37 +00:00
|
|
|
class Encoding;
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
///
|
|
|
|
class Language {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
Language() : RightToLeft_(false) {}
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
Language(string const & l, string const & d, bool rtl, Encoding const * e)
|
|
|
|
: lang_(l), display_(d), RightToLeft_(rtl) , encoding_(e) {}
|
2000-06-08 23:16:16 +00:00
|
|
|
///
|
|
|
|
string const & lang() const {
|
|
|
|
return lang_;
|
|
|
|
}
|
|
|
|
///
|
|
|
|
string const & display() const {
|
|
|
|
return display_;
|
|
|
|
}
|
|
|
|
///
|
|
|
|
bool RightToLeft() const {
|
|
|
|
return RightToLeft_;
|
|
|
|
}
|
2000-07-04 20:32:37 +00:00
|
|
|
///
|
|
|
|
Encoding const * encoding() const {
|
|
|
|
return encoding_;
|
|
|
|
}
|
2000-06-08 23:16:16 +00:00
|
|
|
private:
|
|
|
|
///
|
|
|
|
string lang_;
|
|
|
|
///
|
|
|
|
string display_;
|
|
|
|
///
|
|
|
|
bool RightToLeft_;
|
2000-07-04 20:32:37 +00:00
|
|
|
///
|
|
|
|
Encoding const * encoding_;
|
2000-03-10 13:52:19 +00:00
|
|
|
};
|
|
|
|
|
2000-04-26 13:57:28 +00:00
|
|
|
#if 0
|
|
|
|
bool operator==(Language const & l1, Language const & l2)
|
|
|
|
{
|
|
|
|
return l1.lang == l2.lang
|
2000-07-04 20:32:37 +00:00
|
|
|
&& l1.display_ == l2.display_
|
|
|
|
&& l1.RightToLeft_ == l2.RightToLeft_
|
|
|
|
&& l1.encoding_ == l2.encoding_;
|
2000-04-26 13:57:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool operator!=(Language const l1, Language const & l2)
|
|
|
|
{
|
|
|
|
return !(l1 == l2);
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2000-04-04 00:19:15 +00:00
|
|
|
typedef std::map<string, Language> Languages;
|
2000-03-10 13:52:19 +00:00
|
|
|
extern Languages languages;
|
2000-03-17 10:14:46 +00:00
|
|
|
extern Language const * default_language;
|
2000-04-26 13:57:28 +00:00
|
|
|
extern Language const *ignore_language;
|
2000-03-10 13:52:19 +00:00
|
|
|
|
|
|
|
#endif
|