summaryrefslogtreecommitdiffstats
path: root/tools/localize/Configuration.h
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
commit9066cfe9886ac131c34d59ed0e2d287b0e3c0087 (patch)
treed88beb88001f2482911e3d28e43833b50e4b4e97 /tools/localize/Configuration.h
parentd83a98f4ce9cfa908f5c54bbd70f03eec07e7553 (diff)
downloadframeworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.zip
frameworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.tar.gz
frameworks_base-9066cfe9886ac131c34d59ed0e2d287b0e3c0087.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'tools/localize/Configuration.h')
-rw-r--r--tools/localize/Configuration.h38
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