X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;ds=sidebyside;f=ref.h;h=e7d41e1d998a8ae8a28582d30a29590da7351f58;hb=cae5d6103b0efeb5cd34cd67c65df745ef4d598b;hp=13eba9401c9e8beaa51910c4f6016e4616ee0f06;hpb=c26f44fe8cd3eeec0d9d849cb2e639d484de5887;p=cumulus.git diff --git a/ref.h b/ref.h index 13eba94..e7d41e1 100644 --- a/ref.h +++ b/ref.h @@ -64,11 +64,13 @@ std::string generate_uuid(); * and converted to and from the text representation. */ class ObjectReference { public: + ObjectReference(); ObjectReference(const std::string& segment, int sequence); ObjectReference(const std::string& segment, const std::string& sequence); + bool is_null() const { return segment.size() == 0; } std::string to_string() const; - static ObjectReference *parse(const std::string& s); + static ObjectReference parse(const std::string& s); std::string get_segment() const { return segment; } std::string get_sequence() const { return object; } @@ -87,6 +89,8 @@ public: void set_range(size_t start, size_t length) { range_start = start; range_length = length; range_valid = true; } + bool merge(ObjectReference ref); + private: std::string segment, object, checksum; size_t range_start, range_length;