monotone

monotone Mtn Source Tree

Root/rcs_file.hh

1#ifndef __RCS_FILE_HH__
2#define __RCS_FILE_HH__
3
4// copyright (C) 2002, 2003 graydon hoare <graydon@pobox.com>
5// all rights reserved.
6// licensed to the public under the terms of the GNU GPL (>= 2)
7// see the file COPYING for details
8
9#include <vector>
10#include <string>
11#include <map>
12#include <boost/shared_ptr.hpp>
13
14struct rcs_symbol
15{
16 std::string version;
17 std::string name;
18};
19
20struct rcs_admin
21{
22 std::string head;
23 std::string branch;
24 std::string access;
25 std::multimap<std::string, std::string> symbols;
26 std::multimap<std::string, std::string> locks;
27 std::string comment;
28 std::string expand;
29 void push_symbol(rcs_symbol const & s)
30 {
31 symbols.insert(make_pair(s.version, s.name));
32 }
33};
34
35struct rcs_delta
36{
37 std::string num;
38 std::string date;
39 std::string author;
40 std::string state;
41 std::vector<std::string> branches;
42 std::string next;
43 void push_branch(std::string const & b)
44 {
45 branches.push_back(b);
46 }
47};
48
49struct rcs_deltatext
50{
51 std::string num;
52 std::string log;
53 std::string text;
54};
55
56struct rcs_file
57{
58 rcs_admin admin;
59 std::map<std::string, boost::shared_ptr<rcs_delta> > deltas;
60 std::string desc;
61 std::map<std::string, boost::shared_ptr<rcs_deltatext> > deltatexts;
62 void push_delta(rcs_delta const & d)
63 {
64 boost::shared_ptr<rcs_delta> dp(new rcs_delta(d));
65 deltas.insert(make_pair(dp->num,dp));
66 }
67 void push_deltatext(rcs_deltatext const & dt)
68 {
69 boost::shared_ptr<rcs_deltatext> dp(new rcs_deltatext(dt));
70 deltatexts.insert(make_pair(dp->num, dp));
71 }
72};
73
74void parse_rcs_file(std::string const & filename, rcs_file & r);
75
76#endif // __RCS_FILE_HH__

Archive Download this file

Branches

Tags

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