summaryrefslogtreecommitdiffstats
path: root/tools/localize/Values.h
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit54b6cfa9a9e5b861a9930af873580d6dc20f773c (patch)
tree35051494d2af230dce54d6b31c6af8fc24091316 /tools/localize/Values.h
downloadframeworks_base-54b6cfa9a9e5b861a9930af873580d6dc20f773c.zip
frameworks_base-54b6cfa9a9e5b861a9930af873580d6dc20f773c.tar.gz
frameworks_base-54b6cfa9a9e5b861a9930af873580d6dc20f773c.tar.bz2
Initial Contribution
Diffstat (limited to 'tools/localize/Values.h')
-rw-r--r--tools/localize/Values.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/localize/Values.h b/tools/localize/Values.h
new file mode 100644
index 0000000..0a60b6d
--- /dev/null
+++ b/tools/localize/Values.h
@@ -0,0 +1,48 @@
+#ifndef VALUES_H
+#define VALUES_H
+
+#include "Configuration.h"
+#include "XMLHandler.h"
+
+#include <string>
+
+using namespace std;
+
+enum {
+ CURRENT_VERSION,
+ OLD_VERSION
+};
+
+struct StringResource
+{
+ StringResource();
+ StringResource(const SourcePos& pos, const string& file, const Configuration& config,
+ const string& id, int index, XMLNode* value,
+ int version, const string& versionString, const string& comment = "");
+ StringResource(const StringResource& that);
+
+ // Compare two configurations
+ int Compare(const StringResource& that) const;
+
+ inline bool operator<(const StringResource& that) const { return Compare(that) < 0; }
+ inline bool operator<=(const StringResource& that) const { return Compare(that) <= 0; }
+ inline bool operator==(const StringResource& that) const { return Compare(that) == 0; }
+ inline bool operator!=(const StringResource& that) const { return Compare(that) != 0; }
+ inline bool operator>=(const StringResource& that) const { return Compare(that) >= 0; }
+ inline bool operator>(const StringResource& that) const { return Compare(that) > 0; }
+
+ string TypedID() const;
+ static bool ParseTypedID(const string& typed, string* id, int* index);
+
+ SourcePos pos;
+ string file;
+ Configuration config;
+ string id;
+ int index;
+ XMLNode* value;
+ int version;
+ string versionString;
+ string comment;
+};
+
+#endif // VALUES_H