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;
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;
+}
class ObjectReference {
public:
ObjectReference(const std::string& segment, int sequence);
+ ObjectReference(const std::string& segment, const std::string& sequence);
std::string to_string() const;
+ static ObjectReference *parse(const std::string& s);
std::string get_segment() const { return segment; }
- void set_segment(const std::string& segment) { this->segment = segment; }
+ std::string get_sequence() const { return object; }
+ std::string get_basename() const { return segment + "/" + object; }
bool has_checksum() const { return checksum_valid; }
std::string get_checksum() const { return checksum; }