Changeset 5735dda in nscp for modules/CheckExternalScripts
- Timestamp:
- 06/13/10 22:02:07 (3 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- f0607c4
- Parents:
- 5cd6bcf (diff), f1d6990 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- modules/CheckExternalScripts
- Files:
-
- 1 added
- 3 deleted
- 4 edited
-
CheckExternalScripts.cpp (modified) (2 diffs)
-
CheckExternalScripts.h (modified) (1 diff)
-
CMakeLists.txt (added)
-
CheckExternalScripts-2005.vcproj (deleted)
-
CheckExternalScripts-2008.vcproj (deleted)
-
CheckExternalScripts.def (modified) (1 diff)
-
Jamfile (deleted)
-
stdafx.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
modules/CheckExternalScripts/CheckExternalScripts.cpp
rcad08fb r5735dda 56 56 } 57 57 } 58 } 59 60 61 std::wstring CheckExternalScripts::getWrapping(std::wstring val) { 62 strEx::token tok = strEx::getToken(val, ' ', true); 63 std::wstring::size_type pos = tok.first.find_last_of(_T(".")); 64 if (pos == std::wstring::npos) 65 return _T(""); 66 return tok.first.substr(pos+1); 67 } 68 69 void CheckExternalScripts::addWrappedCommand(std::wstring key, std::wstring tpl, std::wstring command ) { 70 strEx::token tok = strEx::getToken(command, ' ', true); 71 strEx::replace(tpl, _T("%SCRIPT%"), tok.first); 72 strEx::replace(tpl, _T("%ARGS%"), tok.second); 73 tok = strEx::getToken(tpl, ' ', true); 74 addCommand(key.c_str(),tok.first, tok.second); 58 75 } 59 76 … … 99 116 } 100 117 118 std::map<std::wstring,std::wstring> wrappers; 119 std::list<std::wstring> wrappings = GET_CORE()->getSettingsSection(setting_keys::external_scripts::WRAPPINGS_SECTION_PATH); 120 for (it = wrappings.begin(); it != wrappings.end(); ++it) { 121 std::wstring val = GET_CORE()->getSettingsString(setting_keys::external_scripts::WRAPPINGS_SECTION_PATH, *it, _T("")); 122 if (!(*it).empty() && !val.empty()) { 123 wrappers[(*it)] = val; 124 } 125 } 126 std::list<std::wstring> wscript = GET_CORE()->getSettingsSection(setting_keys::external_scripts::WRAPPED_SCRIPT_PATH); 127 for (it = wscript.begin(); it != wscript.end(); ++it) { 128 std::wstring val = GET_CORE()->getSettingsString(setting_keys::external_scripts::WRAPPED_SCRIPT_PATH, *it, _T("")); 129 if (!(*it).empty() && !val.empty()) { 130 std::wstring type = getWrapping(val); 131 std::map<std::wstring,std::wstring>::const_iterator cit = wrappers.find(type); 132 if (cit == wrappers.end()) { 133 NSC_LOG_ERROR_STD(_T("Failed to find wrappings for: ") + type + _T(" (" + (*it) + _T(")"))); 134 } else { 135 addWrappedCommand((*it), (*cit).second, val); 136 } 137 } 138 } 139 101 140 if (!scriptDirectory_.empty()) { 102 141 addAllScriptsFrom(scriptDirectory_); -
modules/CheckExternalScripts/CheckExternalScripts.h
rcad08fb r5735dda 96 96 GET_CORE()->registerCommand(key, _T("Alias for: ") + cd.to_string()); 97 97 } 98 std::wstring getWrapping( std::wstring val ); 99 void addWrappedCommand( std::wstring key, std::wstring tpl, std::wstring command ); 98 100 }; 99 101 -
modules/CheckExternalScripts/CheckExternalScripts.def
rc1d545e rcad08fb 11 11 NSHandleCommand 12 12 NSUnloadModule 13 NSGetConfigurationMeta14 13 NSGetModuleDescription 14 NSDeleteBuffer -
modules/CheckExternalScripts/stdafx.h
rc1d545e rcad08fb 21 21 #pragma once 22 22 23 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers24 // Windows Header Files:25 #include <windows.h>26 27 23 #include <string> 28 24 #include <functional> 29 30 #include <config.h>31 25 #include <utils.h> 32 26 27 #include <boost/lexical_cast.hpp> 28 29 #include <types.hpp> 33 30 #include <NSCAPI.h> 34 #include < NSCHelper.h>31 #include <nscapi/plugin.hpp> 35 32 36 33 #ifdef MEMCHECK
Note: See TracChangeset
for help on using the changeset viewer.








