monotone

monotone Mtn Source Tree

Root/asciik.hh

1#ifndef __ASCIIK_HH__
2#define __ASCIIK_HH__
3
4#include <set>
5#include <vector>
6
7#include "revision.hh"
8
9class asciik
10{
11public:
12 asciik(std::ostream & os, size_t min_width = 0);
13 // Prints an ASCII-k chunk using the given revisions.
14 // Multiple lines are supported in annotation (the graph will stretch
15 // accordingly); empty newlines at the end will be removed.
16 void print(revision_id const & rev,
17 std::set<revision_id> const & parents,
18 std::string const & annotation);
19 //TODO: change set-of-parents to vector-of-successors
20private:
21 void links_cross(std::set<std::pair<size_t, size_t> > const & links,
22 std::set<size_t> & crosses) const;
23 void draw(size_t const curr_items,
24 size_t const next_items,
25 size_t const curr_loc,
26 std::set<std::pair<size_t, size_t> > const & links,
27 std::set<size_t> const & curr_ghosts,
28 std::string const & annotation) const;
29 bool try_draw(std::vector<revision_id> const & next_row,
30 size_t const curr_loc,
31 std::set<revision_id> const & parents,
32 std::string const & annotation) const;
33 // internal state
34 size_t width;
35 std::ostream & output;
36 std::vector<revision_id> curr_row;
37};
38
39#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status