Changeset 9661f81 in nscp for include/parsers/where.cpp


Ignore:
Timestamp:
05/10/10 22:17:31 (3 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2, stable
Children:
f40d813
Parents:
d1029bd
Message:

2010-05-10 MickeM - 0.3.8 RC2

  • Fixed issue with listpdh and debugpdh (not works again) + Fixed issue and added support for IN ( ... ) and NOT IN ( ... ) operators (CheckEventLog)

2010-05-08 MickeM

+ Added new "script templating" thing to simplify adding scripts:

Two new sections: [Script Wrappings] for adding templates and [Wrapped Scripts] for adding the scripts.

%SCRIPT% is replaced with the script name
%ARGS% is replaced with arguments.

vbs=cscript.exe T:30 NoLogo scripts\wrapper.vbs %SCRIPT% %ARGS%

and

w_vbs=check_test.vbs /arg1:1 /arg2:1 /variable:1

is the same as:

w_vbs=cscript.exe T:30 NoLogo scripts\wrapper.vbs check_test.vbs /arg1:1 /arg2:1 /variable:1

  • Added correct syntax for VB scripts
  • Added correct syntax for powershell scripts
  • Cleaned up scripts folder + Added new "NagiosPlugin? library" from op5 + Added check_no_rdp.vbs (Checks that no RDP connection is online) + Added check_battery.vbs which checks batterys via WMI + Added check_printer.vbs to check printers via WMI
File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/parsers/where.cpp

    redf0848 r9661f81  
    3737 
    3838      value_type operator()(expression_ast<THandler> & ast) { 
     39        //std::wcout << _T(">>>Setting type: ") << ast.to_string() << _T(" to: ") << ast.get_type() << std::endl; 
    3940        value_type type = ast.get_type(); 
     41        //std::wcout << _T("!!!Setting type: ") << ast.to_string() << _T(" to: ") << type << std::endl; 
    4042        if (type != type_tbd) 
    4143          return type; 
    4244        type = boost::apply_visitor(*this, ast.expr); 
    4345        ast.set_type(type); 
     46        //std::wcout << _T("<<<Setting type: ") << ast.to_string() << _T(" to: ") << ast.get_type() << std::endl; 
    4447        return type; 
    4548      } 
     
    7174          return type_tbd; 
    7275        if (handler.can_convert(rt, lt)) { 
    73           std::wcout << _T("FORCE 001") << std::endl; 
     76          //std::wcout << _T("FORCE 001") << std::endl; 
    7477          right.force_type(lt); 
    7578          return lt; 
    7679        } 
    7780        if (handler.can_convert(lt, rt)) { 
    78           std::wcout << _T("FORCE 002") << std::endl; 
     81          //std::wcout << _T("FORCE 002") << std::endl; 
    7982          left.force_type(rt); 
    8083          return rt; 
    8184        } 
    8285        if (can_convert(rt, lt)) { 
    83           std::wcout << _T("FORCE 003") << std::endl; 
     86          //std::wcout << _T("FORCE 003") << std::endl; 
    8487          right.force_type(lt); 
    8588          return rt; 
    8689        } 
    8790        if (can_convert(lt, rt)) { 
    88           std::wcout << _T("FORCE 004") << std::endl; 
     91          //std::wcout << _T("FORCE 004") << std::endl; 
    8992          left.force_type(rt); 
    9093          return lt; 
     
    110113 
    111114      value_type operator()(list_value<THandler> & expr) { 
     115        BOOST_FOREACH(expression_ast<THandler> &e, expr.list) { 
     116          operator()(e); 
     117        } 
    112118        return type_tbd; 
    113119      } 
     
    171177 
    172178      bool operator()(list_value<THandler> & expr) { 
    173         // TODO: this is incorrect! 
     179        BOOST_FOREACH(expression_ast<THandler> e, expr.list) { 
     180          operator()(e); 
     181        } 
    174182        return true; 
    175183      } 
     
    218226 
    219227      bool operator()(list_value<THandler> & expr) { 
    220         BOOST_FOREACH(expression_ast<THandler> e, expr.list) { 
     228        BOOST_FOREACH(expression_ast<THandler> &e, expr.list) { 
    221229          operator()(e); 
    222230        } 
     
    242250    bool parser<THandler>::parse(std::wstring expr) { 
    243251      constants::reset(); 
    244       std::wcout << _T("Current time is: ") << constants::get_now() << std::endl; 
     252      //std::wcout << _T("Current time is: ") << constants::get_now() << std::endl; 
    245253      typedef std::wstring::const_iterator iterator_type; 
    246254      typedef where_grammar<THandler, iterator_type> grammar; 
Note: See TracChangeset for help on using the changeset viewer.