# # # patch "asciik.cc" # from [6c7c24a0bb3cef25de1f65ef6cc536fdc28b82a8] # to [e248fa3f38ac16b54618558bfa3ce48892484849] # # patch "asciik.hh" # from [5ee111c1d644c8d03784227d9664c14c6631c418] # to [30f3de29f95bb4effb65ba39a5841858e3d4a005] # ============================================================ --- asciik.cc 6c7c24a0bb3cef25de1f65ef6cc536fdc28b82a8 +++ asciik.cc e248fa3f38ac16b54618558bfa3ce48892484849 @@ -126,14 +126,10 @@ Loop: #include #include #include -#include -#include -//#include -// tuples are faster than std::pair on copy constructors, but we're only using -// std::pair so it probably doesn't matter much #include "asciik.hh" #include "cmd.hh" +#include "simplestring_xform.hh" using std::insert_iterator; using std::max; @@ -144,8 +140,6 @@ using std::vector; using std::set; using std::string; using std::vector; -using boost::algorithm::split; -using boost::algorithm::is_any_of; static revision_id ghost; // valid but empty revision_id to be used as ghost value @@ -245,7 +239,7 @@ asciik::draw(const size_t curr_items, co // split a multi-line annotation vector lines; - split(lines, annotation, is_any_of("\n\r")); + split_into_lines(annotation, lines); int num_lines = lines.size(); if (num_lines < 1) lines.push_back(string("")); ============================================================ --- asciik.hh 5ee111c1d644c8d03784227d9664c14c6631c418 +++ asciik.hh 30f3de29f95bb4effb65ba39a5841858e3d4a005 @@ -14,18 +14,23 @@ public: // Prints an ASCII-k chunk using the given revisions. // Multiple lines are supported in annotation (the graph will stretch // accordingly); empty newlines at the end will be removed. - void print(const revision_id & rev, const std::set & parents, - const std::string & annotation); - //TODO: cambiare set-parents to vector-next + void print(revision_id const & rev, + std::set const & parents, + std::string const & annotation); + //TODO: change set-of-parents to vector-of-successors private: - void links_cross(const std::set > & links, - std::set & crosses) const; - void draw(const size_t curr_items, const size_t next_items, - const size_t curr_loc, const std::set > & links, - const std::set & curr_ghosts, const std::string & annotation) const; - bool try_draw(const std::vector & next_row, - const size_t curr_loc, const std::set & parents, - const std::string & annotation) const; + void links_cross(std::set > const & links, + std::set & crosses) const; + void draw(size_t curr_items, + size_t next_items, + size_t curr_loc, + std::set > const & links, + std::set const & curr_ghosts, + std::string const & annotation) const; + bool try_draw(std::vector const & next_row, + size_t curr_loc, + std::set const & parents, + std::string const & annotation) const; // internal state size_t width; std::ostream & output;