X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=ref.cc;h=ff710d2000b43750f08ceb778aaae06cbb167fd3;hb=c26f44fe8cd3eeec0d9d849cb2e639d484de5887;hp=e996c7dc7a7af6e022e90882d2da4f119c6a37c9;hpb=3cfc1643082e60fea72539033b7adb094d236b0a;p=cumulus.git diff --git a/ref.cc b/ref.cc index e996c7d..ff710d2 100644 --- a/ref.cc +++ b/ref.cc @@ -40,6 +40,14 @@ ObjectReference::ObjectReference(const std::string& segment, int sequence) clear_range(); } +ObjectReference::ObjectReference(const std::string& segment, + const std::string& sequence) + : segment(segment), object(sequence) +{ + clear_checksum(); + clear_range(); +} + string ObjectReference::to_string() const { string result = segment + "/" + object; @@ -55,3 +63,12 @@ string ObjectReference::to_string() const return result; } + +/* Parse a string object reference and return a pointer to a new + * ObjectReference. The caller is responsible for freeing the object. NULL is + * returned if there is an error in the syntax. */ +ObjectReference *ObjectReference::parse(const std::string& s) +{ + // TODO: Implement + return NULL; +}