LCOV - code coverage report
Current view: top level - idlc/inc/idlc - options.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 4 7 57.1 %
Date: 2014-04-11 Functions: 4 6 66.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #ifndef _IDLC_OPTIONS_HXX_
      21             : #define _IDLC_OPTIONS_HXX_
      22             : 
      23             : #include <idlc/idlctypes.hxx>
      24             : 
      25             : typedef ::boost::unordered_map< OString,
      26             :                          OString,
      27             :                          HashString,
      28             :                          EqualString > OptionMap;
      29             : 
      30           0 : class IllegalArgument
      31             : {
      32             : public:
      33           0 :     IllegalArgument(const OString& msg)
      34           0 :         : m_message(msg) {}
      35             : 
      36             :     OString  m_message;
      37             : };
      38             : 
      39             : 
      40             : class Options
      41             : {
      42             : public:
      43             :     explicit Options(char const * progname);
      44             :     ~Options();
      45             : 
      46             :     static bool checkArgument(std::vector< std::string > & rArgs, char const * arg, size_t len);
      47             :     static bool checkCommandFile(std::vector< std::string > & rArgs, char const * filename);
      48             : 
      49             :     bool initOptions(std::vector< std::string > & rArgs)
      50             :         throw(IllegalArgument);
      51             :     bool badOption(char const * reason, std::string const & rArg)
      52             :         throw(IllegalArgument);
      53             :     bool setOption(char const * option, std::string const & rArg);
      54             : 
      55             : #if 0  /* @@@ */
      56             :     sal_Bool initOptions(int ac, char* av[], sal_Bool bCmdFile=sal_False)
      57             :         throw( IllegalArgument );
      58             : #endif /* @@@ */
      59             : 
      60             :     OString prepareHelp();
      61             :     OString prepareVersion();
      62             : 
      63             :     const OString&   getProgramName() const;
      64             :     bool                isValid(const OString& option);
      65             :     const OString&   getOption(const OString& option)
      66             :         throw( IllegalArgument );
      67             : 
      68         329 :     const StringVector& getInputFiles() const { return m_inputFiles; }
      69         329 :     bool readStdin() const { return m_stdin; }
      70         473 :     bool verbose() const { return m_verbose; }
      71         329 :     bool quiet() const { return m_quiet; }
      72             : 
      73             : protected:
      74             :     OString  m_program;
      75             :     StringVector    m_inputFiles;
      76             :     bool            m_stdin;
      77             :     bool            m_verbose;
      78             :     bool            m_quiet;
      79             :     OptionMap       m_options;
      80             : };
      81             : 
      82             : #endif // _IDLC_OPTIONS_HXX_
      83             : 
      84             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10