Initial support for efficient sub-file incrementals.
[cumulus.git] / ref.h
diff --git a/ref.h b/ref.h
index deae39c..d1a0e0c 100644 (file)
--- a/ref.h
+++ b/ref.h
@@ -97,6 +97,7 @@ public:
     std::string get_segment() const { return segment; }
     std::string get_sequence() const { return object; }
     std::string get_basename() const { return segment + "/" + object; }
+    ObjectReference base() const { return ObjectReference(segment, object); }
 
     bool has_checksum() const { return checksum_valid; }
     std::string get_checksum() const { return checksum; }
@@ -113,6 +114,12 @@ public:
 
     bool merge(ObjectReference ref);
 
+    // Maybe provide non-string implementations?
+    bool operator==(const ObjectReference &x) const
+        { return to_string() == x.to_string(); }
+    bool operator<(const ObjectReference &x) const
+        { return to_string() < x.to_string(); }
+
 private:
     RefType type;
     std::string segment, object, checksum;