monotone

monotone Mtn Source Tree

Root/src/automate_stdio_helpers.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#ifndef __AUTOMATE_STDIO_HELPERS__
12#define __AUTOMATE_STDIO_HELPERS__
13
14#include <utility>
15
16#include <boost/function.hpp>
17
18#include "commands.hh"
19
20// these are in a class instead of stand-alone just because there's a
21// friend declaration in cmd.hh, which shouldn't have to know about boost::function
22class automate_stdio_helpers
23{
24public:
25 enum force_ticker_t { force_stdio_ticker, no_force_stdio_ticker };
26 static void
27 automate_stdio_shared_setup(app_state & app,
28 std::vector<std::string> const & cmdline,
29 std::vector<std::pair<std::string,std::string> >
30 const * const params,
31 commands::command_id & id,
32 /* reference-to-pointer here is intentional */
33 commands::automate const * & acmd,
34 force_ticker_t ft = force_stdio_ticker);
35 static std::pair<int, std::string>
36 automate_stdio_shared_body(app_state & app,
37 std::vector<std::string> const & cmdline,
38 std::vector<std::pair<std::string,std::string> >
39 const & params,
40 std::ostream & os,
41 boost::function<void()> init_fn,
42 boost::function<void(commands::command_id const &)> pre_exec_fn);
43};
44#endif
45// Local Variables:
46// mode: C++
47// fill-column: 76
48// c-file-style: "gnu"
49// indent-tabs-mode: nil
50// End:
51// 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