diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
| commit | 54b6cfa9a9e5b861a9930af873580d6dc20f773c (patch) | |
| tree | 35051494d2af230dce54d6b31c6af8fc24091316 /tools/localize/Configuration.h | |
| download | frameworks_base-54b6cfa9a9e5b861a9930af873580d6dc20f773c.zip frameworks_base-54b6cfa9a9e5b861a9930af873580d6dc20f773c.tar.gz frameworks_base-54b6cfa9a9e5b861a9930af873580d6dc20f773c.tar.bz2 | |
Initial Contribution
Diffstat (limited to 'tools/localize/Configuration.h')
| -rw-r--r-- | tools/localize/Configuration.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/localize/Configuration.h b/tools/localize/Configuration.h new file mode 100644 index 0000000..f91bf04 --- /dev/null +++ b/tools/localize/Configuration.h @@ -0,0 +1,38 @@ +#ifndef CONFIGURATION_H +#define CONFIGURATION_H + +#include <string> + +using namespace std; + +struct Configuration +{ + string locale; + string vendor; + string orientation; + string density; + string touchscreen; + string keyboard; + string navigation; + string screenSize; + + // Compare two configurations + int Compare(const Configuration& that) const; + + inline bool operator<(const Configuration& that) const { return Compare(that) < 0; } + inline bool operator<=(const Configuration& that) const { return Compare(that) <= 0; } + inline bool operator==(const Configuration& that) const { return Compare(that) == 0; } + inline bool operator!=(const Configuration& that) const { return Compare(that) != 0; } + inline bool operator>=(const Configuration& that) const { return Compare(that) >= 0; } + inline bool operator>(const Configuration& that) const { return Compare(that) > 0; } + + // Parse a directory name, like "values-en-rUS". Return the first segment in resType. + bool ParseDiectoryName(const string& dir, string* resType); + + string ToString() const; +}; + +bool split_locale(const string& in, string* language, string* region); + + +#endif // CONFIGURATION_H |
