1
/* $Id: Threading.h,v 1.5 2004/08/24 21:52:39 terpstra Exp $
3
* Threading.h - Helper which can load a thread tree
5
* Copyright (C) 2002 - Wesley W. Terpstra
9
* Authors: 'Wesley W. Terpstra' <wesley@terpstra.ca>
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; version 2.1.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
#include <MessageId.h>
60
Node(const MessageId& id_) : summary(id_) { }
61
Node() : summary(MessageId()) { }
65
typedef std::vector<Node> Nodes;
67
map<string, int> hashes;
70
typedef Nodes::size_type Key;
72
string load(ESort::Reader* r, const Summary& sum, Key& out); // "" = ok
74
Key size() const { return nodes.size(); }
75
string findprev(Key m, ESort::Reader* r, const Config& cfg, Summary& s);
76
string findnext(Key m, ESort::Reader* r, const Config& cfg, Summary& s);
78
bool hasMessage(string hash) { return hashes.find(hash) != hashes.end(); }
80
set<Summary> replies(Key k);
81
Summary& getSummary(Key m);
83
string draw_tree (ESort::Reader* db); // prepare for row drawing
84
string draw_snippet(ESort::Reader* db, Key root, const Config& cfg);
86
void draw_tree_row (ostream& o, int* h, Key row); // "" = ok
87
void draw_snippet_row(ostream& o, int* h, Key row, Key root); // "" = ok