LCOV - code coverage report
Current view: top level - include/as2js - options.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 1 100.0 %
Date: 2014-11-22 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #ifndef AS2JS_OPTIONS_H
       2             : #define AS2JS_OPTIONS_H
       3             : /* options.h -- written by Alexis WILKE for Made to Order Software Corp. (c) 2005-2014 */
       4             : 
       5             : /*
       6             : 
       7             : Copyright (c) 2005-2014 Made to Order Software Corp.
       8             : 
       9             : http://snapwebsites.org/project/as2js
      10             : 
      11             : Permission is hereby granted, free of charge, to any
      12             : person obtaining a copy of this software and
      13             : associated documentation files (the "Software"), to
      14             : deal in the Software without restriction, including
      15             : without limitation the rights to use, copy, modify,
      16             : merge, publish, distribute, sublicense, and/or sell
      17             : copies of the Software, and to permit persons to whom
      18             : the Software is furnished to do so, subject to the
      19             : following conditions:
      20             : 
      21             : The above copyright notice and this permission notice
      22             : shall be included in all copies or substantial
      23             : portions of the Software.
      24             : 
      25             : THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
      26             : ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
      27             : LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
      28             : FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
      29             : EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
      30             : LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
      31             : WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
      32             : ARISING FROM, OUT OF OR IN CONNECTION WITH THE
      33             : SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
      34             : SOFTWARE.
      35             : 
      36             : */
      37             : 
      38             : #include    <controlled_vars/controlled_vars_auto_init.h>
      39             : 
      40             : #include    <vector>
      41             : #include    <memory>
      42             : 
      43             : 
      44             : namespace as2js
      45             : {
      46             : 
      47             : 
      48             : // Options you can tweak so the compiler reacts in a different
      49             : // manner in different situations (for instance, the \e escape
      50             : // sequence can be used to generate the escape character whenever
      51             : // the extended escape sequences is set to 1).
      52             : //
      53             : // At this time AS_OPTION_STRICT is always set to 1
      54     5987138 : class Options
      55             : {
      56             : public:
      57             :     typedef std::shared_ptr<Options>    pointer_t;
      58             : 
      59             :     enum class option_t
      60             :     {
      61             :         OPTION_UNKNOWN = 0,
      62             : 
      63             :         OPTION_ALLOW_WITH,          // we do NOT allow with() statements by default
      64             :         OPTION_BINARY,
      65             :         OPTION_COVERAGE,
      66             :         OPTION_DEBUG,
      67             :         OPTION_EXTENDED_ESCAPE_SEQUENCES,
      68             :         OPTION_EXTENDED_OPERATORS,  // 1 support extended, 2 or 3 support extended and prevent '=' (use ':=' instead)
      69             :         OPTION_EXTENDED_STATEMENTS, // 1 support extended, 2 or 3 support extended and prevent if()/else/for()/while() ... without the '{' ... '}'
      70             :         OPTION_JSON,
      71             :         OPTION_OCTAL,
      72             :         OPTION_STRICT,
      73             :         OPTION_TRACE,
      74             :         OPTION_UNSAFE_MATH,         // optimize even what can be considered unsafe (see http://stackoverflow.com/questions/6430448/why-doesnt-gcc-optimize-aaaaaa-to-aaaaaa )
      75             : 
      76             :         OPTION_max
      77             :     };
      78             : 
      79             :     typedef int64_t                 option_value_t;
      80             :     typedef controlled_vars::auto_init<option_value_t, 0>   zoption_value_t;
      81             : 
      82             :                                     Options();
      83             : 
      84             :     void                            set_option(option_t option, option_value_t value);
      85             :     option_value_t                  get_option(option_t option);
      86             : 
      87             : private:
      88             :     std::vector<zoption_value_t>    f_options;
      89             : };
      90             : 
      91             : 
      92             : 
      93             : }
      94             : // namespace as2js
      95             : #endif
      96             : // #ifndef AS2JS_OPTIONS_H
      97             : 
      98             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.10