[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Sharing process_one_hunk (applying a rcs diff) between
From: |
Christof Petig |
Subject: |
[Monotone-devel] Sharing process_one_hunk (applying a rcs diff) between rcs_import and cvs_sync |
Date: |
Fri, 07 Oct 2005 14:26:34 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.6 (X11/20050912) |
Hi Graydon,
I would like to share the code which applies rcs diffs between
rcs_import and cvs_sync. My main problems are:
- piece_store stores a vector of boost_shared_ptr<rcs_deltatext> and
processes them. So no way to work on plain strings (which are used
within cvs_sync). It is accessed via ->text.data(). If we could agree to
add a
const char *data() const { return text.data(); }
to rcs_deltatext, I could make piece_store a template to accept either
rcs_deltatext or pointer_emulating_string (see below) by using ->data()
Or we use a more invasive approach and pass only the text member to
piece_store (IIRC a string is only copied on write) and forget about
boost::shared_ptr. I don't see a benefit from using shared_ptr here (I
might overlook something).
- global_pieces is a static global variable within rcs_import.cc, I see
two alternatives: Making global_pieces a static member of piece (at
least looks cleaner) or making piece_store a member of rcs_import (and
dumping piece::operator*). So the second alternative is not really
realistic.
What should I name the new header file containing the template?
piece.hh? apply_rcs_diff.hh? line_spliced_string.hh?
Should I rename the class piece when I form a template? line_spliced_string?
Christof
----
struct pointer_emulating_string : std::string
{
pointer_emulating_string(const std::string &s) : std::string(s) {}
const std::string *operator->() const { return this; }
};
signature.asc
Description: OpenPGP digital signature
- [Monotone-devel] Sharing process_one_hunk (applying a rcs diff) between rcs_import and cvs_sync,
Christof Petig <=