Changeset de7ec29 in nscp
- Timestamp:
- 08/19/10 14:11:37 (3 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- 291548e
- Parents:
- 497b779
- Files:
-
- 7 edited
-
CMakeLists.txt (modified) (1 diff)
-
build.cmake (modified) (1 diff)
-
include/error_impl_unix.hpp (modified) (3 diffs)
-
include/nscapi/settings.hpp (modified) (4 diffs)
-
include/strEx.h (modified) (3 diffs)
-
modules/CheckEventLog/module.cmake (modified) (1 diff)
-
modules/CheckSystem/module.cmake (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r497b779 rde7ec29 262 262 get_filename_component(CURRENT_MODULE_PATH ${CURRENT_MODULE} PATH) 263 263 get_filename_component(CURRENT_MODULE_NAME ${CURRENT_MODULE_PATH} NAME) 264 SET (BUILD_MODULE 0) 264 265 include(${CURRENT_MODULE}) 265 266 IF(BUILD_MODULE) -
build.cmake
r184d575 rde7ec29 24 24 ELSE(WIN32) 25 25 26 SET(INC_ BOOST_INCLUDEDIR "/usr/include/")26 SET(INC_OPENSSL_INCLUDEDIR "/usr/include/") 27 27 28 28 ENDIF(WIN32) -
include/error_impl_unix.hpp
rd05c3f0 rde7ec29 2 2 #include <unicode_char.hpp> 3 3 #include <string> 4 #include <strEx.h> 5 6 using namespace nscp::helpers; 4 7 5 8 namespace error { … … 8 11 static std::wstring from_system(int dwError) { 9 12 char buf [1024]; 10 return to_wstring(::strerror_r(dwError, buf, sizeof (buf)));13 return nscp::helpers::to_wstring(::strerror_r(dwError, buf, sizeof (buf))); 11 14 } 12 15 static std::wstring from_module(std::wstring module, unsigned long dwError) { … … 46 49 } 47 50 static std::string last_error_ansi(int dwLastError = -1) { 48 return to_string(::error::format::from_system(dwLastError));51 return nscp::helpers::to_string(::error::format::from_system(dwLastError)); 49 52 } 50 53 }; -
include/nscapi/settings.hpp
r497b779 rde7ec29 47 47 } 48 48 virtual void notify(nscapi::core_wrapper* core_, std::wstring path, std::wstring key) const { 49 T value = boost::lexical_cast<T>(core_->getSettingsString(path, key, default_value_as_text_));49 T value = boost::lexical_cast<T>(core_->getSettingsString(path, key, typed_key<T>::default_value_as_text_)); 50 50 update_target(&value); 51 51 } … … 59 59 } 60 60 virtual void notify(nscapi::core_wrapper* core_, std::wstring path, std::wstring key) const { 61 std::wstring val = core_->getSettingsString(path, key, default_value_as_text_);61 std::wstring val = core_->getSettingsString(path, key, typed_key<T>::default_value_as_text_); 62 62 T value = boost::lexical_cast<T>(core_->expand_path(val)); 63 63 update_target(&value); … … 68 68 public: 69 69 typed_int_value(const T& v) : typed_key<T>(v), default_value_as_int_(boost::lexical_cast<int>(v)) {} 70 typed_key * default_value(const T& v) {70 typed_key<T>* default_value(const T& v) { 71 71 typed_key<T>::default_value(v); 72 72 default_value_as_int_ = boost::lexical_cast<int>(v); … … 91 91 } 92 92 virtual void notify(nscapi::core_wrapper* core_, std::wstring path, std::wstring key) const { 93 T value = static_cast<T>(core_->getSettingsInt(path, key, default_value_as_int_)==1);93 T value = static_cast<T>(core_->getSettingsInt(path, key, typed_int_value<T>::default_value_as_int_)==1); 94 94 update_target(&value); 95 95 } -
include/strEx.h
r497b779 rde7ec29 680 680 681 681 static int compare( const char_type* s1, const char_type* s2, size_t n ) { 682 #ifdef WIN32 682 683 return memicmp( s1, s2, n ); 683 // if available on your compiler, 684 // otherwise you can roll your own 684 #else 685 while (n-- && eq(*s1, *s2)) 686 ++s1, ++s2; 687 return lt(*s2, *s1) - lt(*s1, *s2); 688 #endif 685 689 } 686 690 … … 831 835 else \ 832 836 strEx::replace(format, key, _T("0")); 833 837 #ifdef WIN32 834 838 inline std::wstring format_time_delta(struct tm *mtm, std::wstring format = _T("%Y years %m months %d days %H hours %M minutes")) { 835 839 // "Date: %Y-%m-%d %H:%M:%S" … … 861 865 return format_time_delta(static_cast<time_t>(filetime), format); 862 866 } 867 endif 863 868 864 869 #ifdef _DEBUG -
modules/CheckEventLog/module.cmake
r497b779 rde7ec29 1 IF(WIN32) 1 2 SET (BUILD_MODULE 1) 2 3 3 ENDIF(WIN32) -
modules/CheckSystem/module.cmake
r497b779 rde7ec29 1 IF(WIN32) 1 2 SET (BUILD_MODULE 1) 2 3 3 ENDIF(WIN32)
Note: See TracChangeset
for help on using the changeset viewer.








