monotone

monotone Mtn Source Tree

Root/asciik.hh

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

Archive Download this file

Branches

Tags

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