monotone

monotone Mtn Source Tree

Root/src/automate_reader.hh

1// Copyright (C) 2005 and later by various people
2// see monotone commit logs for details and authors
3//
4// This program is made available under the GNU GPL version 2.0 or
5// greater. See the accompanying file COPYING for details.
6//
7// This program is distributed WITHOUT ANY WARRANTY; without even the
8// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9// PURPOSE.
10
11
12#ifndef __AUTOMATE_READER_HH__
13#define __AUTOMATE_READER_HH__
14
15#include <vector>
16
17class automate_reader
18{
19 std::istream & in;
20 enum location {opt, cmd, none, eof};
21 location loc;
22 bool get_string(std::string & out);
23 std::streamsize read(char *buf, size_t nbytes, bool eof_ok = false);
24 void go_to_next_item();
25public:
26 automate_reader(std::istream & is);
27 bool get_command(std::vector<std::pair<std::string, std::string> > & params,
28 std::vector<std::string> & cmdline);
29 void reset();
30};
31
32#endif
33
34// Local Variables:
35// mode: C++
36// fill-column: 76
37// c-file-style: "gnu"
38// indent-tabs-mode: nil
39// End:
40// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

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