Page Breaks: IsLeaveWindow() is unreliable, we do not need it here.
[LibreOffice.git] / registry / tools / options.hxx
blobc46aa6ed70f2c546ec0c3dd93e8a3d5be7609452
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 INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX
30 #define INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX
32 #include <string>
33 #include <vector>
35 namespace registry
37 namespace tools
39 class Options
41 std::string m_program;
43 Options (Options const &);
44 Options & operator= (Options const &);
46 public:
47 explicit Options (char const * program);
48 virtual ~Options();
50 static bool checkArgument (std::vector< std::string > & rArgs, char const * arg, size_t len);
52 bool initOptions (std::vector< std::string > & rArgs);
53 bool badOption (char const * reason, char const * option) const;
55 std::string const & getProgramName() const { return m_program; }
56 bool printUsage() const;
58 protected:
59 static bool checkCommandFile(std::vector< std::string > & rArgs, char const * filename);
61 virtual bool initOptions_Impl(std::vector< std::string > & rArgs) = 0;
62 virtual void printUsage_Impl() const = 0;
65 } // namespace tools
66 } // namespace registry
68 #endif /* INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX */
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */