librime 1.2
Rime Input Method Engine, the core library
language.h
Go to the documentation of this file.
1//
2// Copyright RIME Developers
3// Distributed under the BSD License
4//
5#ifndef RIME_LANGUAGE_H_
6#define RIME_LANGUAGE_H_
7
8#include <rime/common.h>
9
10namespace rime {
11
12class Language {
13 const string name_;
14
15 public:
16 Language(const string& name) : name_(name) {}
17 string name() const { return name_; }
18
19 bool operator==(const Language& other) const { return name_ == other.name_; }
20
21 template <class T, class U>
22 static bool intelligible(const T& t, const U& u) {
23 return t && t->language() && u && u->language() &&
24 *t->language() == *u->language();
25 }
26
27 static string get_language_component(const string& name);
28};
29
30} // namespace rime
31
32#endif // RIME_LANGUAGE_H_
Definition algebra.cc:12
static string get_language_component(const string &name)
Definition language.cc:11
bool operator==(const Language &other) const
Definition language.h:19
static bool intelligible(const T &t, const U &u)
Definition language.h:22
Language(const string &name)
Definition language.h:16
string name() const
Definition language.h:17