1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef ADC_ADC_CMD_HXX
21 #define ADC_ADC_CMD_HXX
27 #include <cosv/comdline.hxx>
37 /** Context for a command, which can be read from the command line.
42 typedef StringVector::const_iterator opt_iter
;
57 Context::Init( opt_iter
& i_nCurArgsBegin
,
58 opt_iter i_nEndOfAllArgs
)
60 { do_Init(i_nCurArgsBegin
, i_nEndOfAllArgs
); }
64 /** Interface for commands, autodoc is able to perform.
66 class Command
: public Context
69 /** Running ranks of the commands are to be maintained at one location:
83 int RunningRank() const;
86 virtual bool do_Run() const = 0;
87 virtual int inq_RunningRank() const = 0;
95 Command::RunningRank() const
96 { return inq_RunningRank(); }
101 /** The exception thrown, if the command line is invalid.
107 const char * i_sExplanation
)
108 : sExplanation(i_sExplanation
) {}
111 std::ostream
& o_rOut
)
112 { o_rOut
<< "Error in command line: "
113 << sExplanation
<< Endl(); }
121 } // namespace command
122 } // namespace autodoc
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */