monotone

monotone Mtn Source Tree

Root/rcs_file.hh

1#ifndef __RCS_FILE_HH__
2#define __RCS_FILE_HH__
3
4// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
5//
6// This program is made available under the GNU GPL version 2.0 or
7// greater. See the accompanying file COPYING for details.
8//
9// This program is distributed WITHOUT ANY WARRANTY; without even the
10// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11// PURPOSE.
12
13#include <vector>
14#include <string>
15#include <map>
16#include <boost/shared_ptr.hpp>
17
18struct rcs_admin
19{
20 std::string head;
21 std::string branch;
22 std::multimap<std::string, std::string> symbols;
23};
24
25struct rcs_delta
26{
27 std::string num;
28 std::string date;
29 std::string author;
30 std::vector<std::string> branches;
31 std::string next;
32 std::string state; // dead, Exp (or Stab, Rel)
33};
34
35struct rcs_deltatext
36{
37 std::string num;
38 std::string log;
39 std::string text;
40};
41
42struct rcs_file
43{
44 rcs_admin admin;
45 std::map<std::string, boost::shared_ptr<rcs_delta> > deltas;
46 std::map<std::string, boost::shared_ptr<rcs_deltatext> > deltatexts;
47 void push_delta(rcs_delta const & d)
48 {
49 boost::shared_ptr<rcs_delta> dp(new rcs_delta(d));
50 deltas.insert(make_pair(dp->num,dp));
51 }
52 void push_deltatext(rcs_deltatext const & dt)
53 {
54 boost::shared_ptr<rcs_deltatext> dp(new rcs_deltatext(dt));
55 deltatexts.insert(make_pair(dp->num, dp));
56 }
57};
58
59void parse_rcs_file(std::string const & filename, rcs_file & r);
60
61// Local Variables:
62// mode: C++
63// fill-column: 76
64// c-file-style: "gnu"
65// indent-tabs-mode: nil
66// End:
67// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
68
69#endif // __RCS_FILE_HH__

Archive Download this file

Branches

Tags

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