summaryrefslogtreecommitdiffstats
path: root/src/2geom/ord.h
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-08-30 18:32:36 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-08-30 18:32:36 +0000
commit13e73fa386cd7843d7079ec7c162ef43d15097c4 (patch)
treeab4c7a4f76528e9139a85aa1c1267ecf2c6df8fe /src/2geom/ord.h
parentupdated Slovak (sk) translation in trunk (diff)
downloadinkscape-13e73fa386cd7843d7079ec7c162ef43d15097c4.tar.gz
inkscape-13e73fa386cd7843d7079ec7c162ef43d15097c4.zip
Update to 2Geom rev. 1113
(bzr r3622)
Diffstat (limited to 'src/2geom/ord.h')
-rw-r--r--src/2geom/ord.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/2geom/ord.h b/src/2geom/ord.h
new file mode 100644
index 000000000..d0e348aec
--- /dev/null
+++ b/src/2geom/ord.h
@@ -0,0 +1,37 @@
+
+#ifndef __2GEOM_ORD__
+#define __2GEOM_ORD__
+
+namespace {
+
+enum Cmp {
+ LESS_THAN=-1,
+ GREATER_THAN=1,
+ EQUAL_TO=0
+};
+
+inline Cmp operator-(Cmp x) {
+ switch(x) {
+ case LESS_THAN:
+ return GREATER_THAN;
+ case GREATER_THAN:
+ return LESS_THAN;
+ case EQUAL_TO:
+ return EQUAL_TO;
+ }
+}
+
+template <typename T1, typename T2>
+inline Cmp cmp(T1 const &a, T2 const &b) {
+ if ( a < b ) {
+ return LESS_THAN;
+ } else if ( b < a ) {
+ return GREATER_THAN;
+ } else {
+ return EQUAL_TO;
+ }
+}
+
+}
+
+#endif