Replace boost::scoped_ptr with std::unique_ptr.
[cumulus.git] / ref.h
diff --git a/ref.h b/ref.h
index d1a0e0c..bbbf5b8 100644 (file)
--- a/ref.h
+++ b/ref.h
@@ -1,7 +1,6 @@
-/* Cumulus: Smart Filesystem Backup to Dumb Servers
- *
- * Copyright (C) 2007-2008  The Regents of the University of California
- * Written by Michael Vrable <mvrable@cs.ucsd.edu>
+/* Cumulus: Efficient Filesystem Backup to the Cloud
+ * Copyright (C) 2007-2008 The Cumulus Developers
+ * See the AUTHORS file for a list of contributors.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * a substring rather than the entire string using a range specifier.  If no
  * range specifier is given, then by default the entire object is used.
  *    <range> ::= <start> "+" <length>
+ *                | <length>
+ *                | "=" <length>
  * Both <start> and <length> are decimal values.  If included, the range is
  * enclosed in brackets.  As an abbreviation, if <start> is 0 then the range
- * can be given as just <length> (no "+" needed).
+ * can be given as just <length> (no "+" needed).  The "=<length>" form asserts
+ * that the underlying object is exactly <length> bytes in size.
  *
  * When both a checksum and a range are included, note that the checksum is
  * taken over the entire original object, before the range is taken into
@@ -108,9 +110,13 @@ public:
     bool has_range() const { return range_valid; }
     size_t get_range_start() const { return range_start; }
     size_t get_range_length() const { return range_length; }
-    void clear_range() { range_start = range_length = 0; range_valid = false; }
-    void set_range(size_t start, size_t length)
-        { range_start = start; range_length = length; range_valid = true; }
+    bool range_is_exact() const { return range_exact; }
+    void clear_range()
+        { range_start = range_length = 0;
+          range_valid = false; range_exact = false; }
+    void set_range(size_t start, size_t length, bool exact = false)
+        { range_start = start; range_length = length;
+          range_valid = true; range_exact = exact; }
 
     bool merge(ObjectReference ref);
 
@@ -124,7 +130,7 @@ private:
     RefType type;
     std::string segment, object, checksum;
     size_t range_start, range_length;
-    bool checksum_valid, range_valid;
+    bool checksum_valid, range_valid, range_exact;
 };
 
 #endif // _LBS_REF_H