wpkg test coverage results

Coverage test results of the Windows Packager by Made to Order Software Corporation.

LCOV - code coverage report
Current view: top level - libexpr/libexpr - variable.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 2 2 100.0 %
Date: 2013-07-16 Functions: 6 7 85.7 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*    variable -- the libexpr variable implementation
       2             :  *    Copyright (C) 2007-2013  Made to Order Software Corporation
       3             :  *
       4             :  *    This program is free software; you can redistribute it and/or modify
       5             :  *    it under the terms of the GNU General Public License as published by
       6             :  *    the Free Software Foundation; either version 2 of the License, or
       7             :  *    (at your option) any later version.
       8             :  *
       9             :  *    This program is distributed in the hope that it will be useful,
      10             :  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             :  *    GNU General Public License for more details.
      13             :  *
      14             :  *    You should have received a copy of the GNU General Public License along
      15             :  *    with this program; if not, write to the Free Software Foundation, Inc.,
      16             :  *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      17             :  *
      18             :  *    Authors
      19             :  *    Alexis Wilke   alexis@m2osw.com
      20             :  */
      21             : #ifndef LIBEXPR_VARIABLE_H
      22             : #define LIBEXPR_VARIABLE_H
      23             : 
      24             : #include        "libexpr/exceptions.h"
      25             : #include        <map>
      26             : 
      27             : namespace libexpr
      28             : {
      29             : 
      30             : 
      31       13624 : class EXPR_EXPORT variable
      32             : {
      33             : public:
      34             :         enum type_t {
      35             :                 TYPE_UNDEFINED,
      36             :                 TYPE_INT,
      37             :                 TYPE_FLT,
      38             :                 TYPE_STR
      39             :         };
      40             : 
      41             :         variable();
      42             : 
      43             :         std::string get_name() const;
      44             :         void set_name(const std::string& name);
      45             : 
      46             :         type_t type() const;
      47             :         void reset();
      48             :         void get(long& value) const;
      49             :         void get(double& value) const;
      50             :         void get(std::string& str) const;
      51             :         void set(bool value);
      52             :         void set(long value);
      53             :         void set(double value);
      54             :         void set(const std::string& str);
      55             :         void set(const std::wstring& str);
      56             :         void set(const char *str);
      57             :         void set(const wchar_t *str);
      58             :         // XXX add char16 and char32 for tr1/C++11
      59             :         void to_string(std::string& str) const;
      60             : 
      61             :         // arithmetic
      62             :         void neg(const variable& v1);
      63             :         void pls(const variable& v1);
      64             :         void mul(const variable& v1, const variable& v2);
      65             :         void div(const variable& v1, const variable& v2);
      66             :         void mod(const variable& v1, const variable& v2);
      67             :         void add(const variable& v1, const variable& v2);
      68             :         void sub(const variable& v1, const variable& v2);
      69             :         void bitwise_and(const variable& v1, const variable& v2);
      70             :         void bitwise_or(const variable& v1, const variable& v2);
      71             :         void bitwise_xor(const variable& v1, const variable& v2);
      72             :         void bitwise_not(const variable& v1);
      73             : 
      74             :         // shift
      75             :         void shl(const variable& v1, const variable& v2);
      76             :         void shr(const variable& v1, const variable& v2);
      77             : 
      78             :         // comparisons
      79             :         void lt(const variable& v1, const variable& v2);
      80             :         void le(const variable& v1, const variable& v2);
      81             :         void eq(const variable& v1, const variable& v2);
      82             :         void ne(const variable& v1, const variable& v2);
      83             :         void ge(const variable& v1, const variable& v2);
      84             :         void gt(const variable& v1, const variable& v2);
      85             : 
      86             :         // logic
      87             :         void logic_and(const variable& v1, const variable& v2);
      88             :         void logic_or(const variable& v1, const variable& v2);
      89             :         void logic_xor(const variable& v1, const variable& v2);
      90             :         void logic_not(const variable& v1);
      91             : 
      92             : private:
      93             :         void validate_type(type_t t) const;
      94             : 
      95             :         type_t                  f_type;
      96             :         std::string             f_name;
      97             :         long                    f_int;
      98             :         double                  f_flt;
      99             :         std::string             f_str;
     100             : };
     101             : 
     102             : 
     103             : 
     104             : 
     105        1170 : class EXPR_EXPORT variable_list
     106             : {
     107             : public:
     108             :         bool get(const std::string& name, variable& var) const;
     109             :         void set(const std::string& name, const variable& var);
     110             : 
     111             : private:
     112             :         typedef std::map<const std::string, variable>     list_t;
     113             :         typedef std::pair<const std::string, variable>    pair_t;
     114             :         list_t                  f_list;
     115             : };
     116             : 
     117             : 
     118             : 
     119             : 
     120             : 
     121             : }
     122             : #endif
     123             : // LIBEXPR_EXCEPTIONS_H

Generated by: LCOV version 1.9

The wpkg tool is an open source tool created by Made to Order Software Corporation.