1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef ADC_ADC_CMD_HXX
30 #define ADC_ADC_CMD_HXX
36 #include <cosv/comdline.hxx>
46 /** Context for a command, which can be read from the command line.
51 typedef StringVector::const_iterator opt_iter
;
66 Context::Init( opt_iter
& i_nCurArgsBegin
,
67 opt_iter i_nEndOfAllArgs
)
69 { do_Init(i_nCurArgsBegin
, i_nEndOfAllArgs
); }
73 /** Interface for commands, autodoc is able to perform.
75 class Command
: public Context
78 /** Running ranks of the commands are to be maintained at one location:
92 int RunningRank() const;
95 virtual bool do_Run() const = 0;
96 virtual int inq_RunningRank() const = 0;
104 Command::RunningRank() const
105 { return inq_RunningRank(); }
110 /** The exception thrown, if the command line is invalid.
116 const char * i_sExplanation
)
117 : sExplanation(i_sExplanation
) {}
120 std::ostream
& o_rOut
)
121 { o_rOut
<< "Error in command line: "
122 << sExplanation
<< Endl(); }
130 } // namespace command
131 } // namespace autodoc
134 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */