monotone

monotone Mtn Source Tree

Root/asciik.hh

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

Archive Download this file

Branches

Tags

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