Index: ext/libicpf/configure.ac =================================================================== diff -u -N -re17c80d36eaa0430313e7d1058aa7a301d1510af -rfd1f0cf4d6ad9ff63fd9252a3f2f31c992431842 --- ext/libicpf/configure.ac (.../configure.ac) (revision e17c80d36eaa0430313e7d1058aa7a301d1510af) +++ ext/libicpf/configure.ac (.../configure.ac) (revision fd1f0cf4d6ad9ff63fd9252a3f2f31c992431842) @@ -1,46 +1,46 @@ -AC_INIT(libicpf, 0.1alpha, ixen2@o2.pl) -AC_CONFIG_SRCDIR([config.h.in]) -AC_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE(libicpf, 0.1alpha) - -# Programs -AC_PROG_CXX -AC_PROG_CC -AC_PROG_CPP -AC_PROG_AWK -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AC_PROG_RANLIB -AC_PROG_LIBTOOL - -# libraries -AC_CHECK_LIB([dl], [dlopen]) -AC_CHECK_LIB([pthread], [pthread_mutex_init]) - -# header files -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h utime.h wchar.h pthread.h]) - -# typedefs, structs, ... -AC_HEADER_STDBOOL -AC_C_CONST -AC_TYPE_UID_T -AC_C_INLINE -AC_TYPE_OFF_T -AC_TYPE_SIZE_T - -# library functions -AC_FUNC_CHOWN -AC_FUNC_CLOSEDIR_VOID -AC_FUNC_LSTAT -AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK -AC_FUNC_UTIME_NULL -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([ftruncate memmove memset strchr strtoul utime]) - -AC_CONFIG_FILES([Makefile - src/Makefile]) - -AC_OUTPUT +AC_INIT(libicpf, 0.1alpha, ixen2@o2.pl) +AC_CONFIG_SRCDIR([config.h.in]) +AC_CONFIG_HEADER([config.h]) +AM_INIT_AUTOMAKE(libicpf, 2.0alpha) + +# Programs +AC_PROG_CXX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_AWK +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB +AC_PROG_LIBTOOL + +# libraries +AC_CHECK_LIB([dl], [dlopen]) +AC_CHECK_LIB([pthread], [pthread_mutex_init]) + +# header files +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h utime.h wchar.h pthread.h]) + +# typedefs, structs, ... +AC_HEADER_STDBOOL +AC_C_CONST +AC_TYPE_UID_T +AC_C_INLINE +AC_TYPE_OFF_T +AC_TYPE_SIZE_T + +# library functions +AC_FUNC_CHOWN +AC_FUNC_CLOSEDIR_VOID +AC_FUNC_LSTAT +AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK +AC_FUNC_UTIME_NULL +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([ftruncate memmove memset strchr strtoul utime]) + +AC_CONFIG_FILES([Makefile + src/Makefile]) + +AC_OUTPUT Index: ext/libicpf/src/Makefile.am =================================================================== diff -u -N -r2446443341715955423610c01b43fe7841a10e3e -rfd1f0cf4d6ad9ff63fd9252a3f2f31c992431842 --- ext/libicpf/src/Makefile.am (.../Makefile.am) (revision 2446443341715955423610c01b43fe7841a10e3e) +++ ext/libicpf/src/Makefile.am (.../Makefile.am) (revision fd1f0cf4d6ad9ff63fd9252a3f2f31c992431842) @@ -1,18 +1,16 @@ -lib_LTLIBRARIES = libicpf.la -libicpf_la_SOURCES = callback.cpp exception.cpp circ_buffer.cpp \ - str.cpp log.cpp dumpctx.cpp cfg.cpp str_help.cpp \ - crc32.cpp file.cpp module.cpp conv.cpp crypt.cpp rijndael-alg-fst.c \ - rijndael-api-fst.c sha256.c mutex.cpp - -# set the include path found by configure -INCLUDES = $(all_includes) - -# the library search path. -libicpf_la_LDFLAGS = $(all_libraries) -libicpf_la_LIBADD = -ldl -lpthread -dist_include_HEADERS = callback.h exception.h str.h dumpctx.h cfg.h circ_buffer.h module.h \ - file.h log.h cfg.h str_help.h crc32.h libicpf.h gen_types.h \ - conv.h crypt.h err_codes.h gen_types.h macros.h mutex.h \ - rijndael-alg-fst.h rijndael-api-fst.h sha256.h -AM_CFLAGS = -Wall -Wshadow -DLIBICPF_EXPORTS -AM_CXXFLAGS = -Wall -Wshadow -DLIBICPF_EXPORTS +lib_LTLIBRARIES = libicpf.la +libicpf_la_SOURCES = callback.cpp exception.cpp circ_buffer.cpp \ + log.cpp dumpctx.cpp cfg.cpp cfg_xml.cpp config_property.cpp str_help.cpp \ + crc32.cpp file.cpp module.cpp conv.cpp mutex.cpp + +# set the include path found by configure +INCLUDES = $(all_includes) + +# the library search path. +#libicpf_la_LDFLAGS = $(all_libraries) +libicpf_la_LIBADD = -ldl -lpthread +dist_include_HEADERS = callback.h exception.h dumpctx.h cfg.h circ_buffer.h module.h \ + file.h log.h cfg.h config_base.h config_property.h str_help.h crc32.h libicpf.h gen_types.h \ + conv.h err_codes.h gen_types.h macros.h mutex.h +AM_CFLAGS = -Wall -Wshadow -DLIBICPF_EXPORTS +AM_CXXFLAGS = -Wall -Wshadow -DLIBICPF_EXPORTS Index: ext/libicpf/src/cfg_xml.h =================================================================== diff -u -N -r0d9a4d94a98872815d5840d1bcc4d394d455307c -rfd1f0cf4d6ad9ff63fd9252a3f2f31c992431842 --- ext/libicpf/src/cfg_xml.h (.../cfg_xml.h) (revision 0d9a4d94a98872815d5840d1bcc4d394d455307c) +++ ext/libicpf/src/cfg_xml.h (.../cfg_xml.h) (revision fd1f0cf4d6ad9ff63fd9252a3f2f31c992431842) @@ -39,7 +39,7 @@ virtual void find_close(ptr_t pFindHandle); /// Sets a value for a given key - virtual void set_value(const tchar_t* pszName, const tchar_t* pszValue, actions a=actions::action_add); + virtual void set_value(const tchar_t* pszName, const tchar_t* pszValue, actions a=action_add); /// Clear values for a given property name virtual void clear(const tchar_t* pszName); /**@}*/ @@ -48,7 +48,7 @@ /// Find helper - recursively searches for a specific key node ptr_t find(ptr_t pNodePtr, const tchar_t* pszName); /// Set value helper - searches for a specific node and sets the value - void set_value(ptr_t pNodePtr, const tchar_t* pszName, const tchar_t* pszValue, actions a=actions::action_add); + void set_value(ptr_t pNodePtr, const tchar_t* pszName, const tchar_t* pszValue, actions a=action_add); /// Clear helper - clears the appropriate attribures void clear(ptr_t pNodePtr, const tchar_t* pszName); Index: ext/libicpf/src/config_base.h =================================================================== diff -u -N -r0d9a4d94a98872815d5840d1bcc4d394d455307c -rfd1f0cf4d6ad9ff63fd9252a3f2f31c992431842 --- ext/libicpf/src/config_base.h (.../config_base.h) (revision 0d9a4d94a98872815d5840d1bcc4d394d455307c) +++ ext/libicpf/src/config_base.h (.../config_base.h) (revision fd1f0cf4d6ad9ff63fd9252a3f2f31c992431842) @@ -39,7 +39,7 @@ virtual void find_close(ptr_t pFindHandle) = 0; /// Sets a value for a given key - virtual void set_value(const tchar_t* pszName, const tchar_t* pszValue, actions a=actions::action_add) = 0; + virtual void set_value(const tchar_t* pszName, const tchar_t* pszValue, actions a=action_add) = 0; /// Clear values for a given property name virtual void clear(const tchar_t* pszName) = 0; /**@}*/ Index: ext/libicpf/src/config_property.cpp =================================================================== diff -u -N -r771dac1fbb7608aa92942c6cab7c5c8b0cccb791 -rfd1f0cf4d6ad9ff63fd9252a3f2f31c992431842 --- ext/libicpf/src/config_property.cpp (.../config_property.cpp) (revision 771dac1fbb7608aa92942c6cab7c5c8b0cccb791) +++ ext/libicpf/src/config_property.cpp (.../config_property.cpp) (revision fd1f0cf4d6ad9ff63fd9252a3f2f31c992431842) @@ -15,7 +15,7 @@ /** Constructs a property object. */ property::property() : - m_uiPropType(prop_type::type_unknown | prop_flags::flag_none), + m_uiPropType(type_unknown | flag_none), m_pszName(NULL) { memset(&m_val, 0, sizeof(_VALUE)); @@ -63,21 +63,21 @@ clear_value(); // copy the value(s) - if (rSrc.m_uiPropType & prop_flags::flag_array) + if (rSrc.m_uiPropType & flag_array) { // source property is an array - switch(rSrc.m_uiPropType & prop_mask::mask_type) + switch(rSrc.m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: m_val.hArray=new std::vector(*(std::vector*)rSrc.m_val.hArray); break; - case prop_type::type_signed_num: + case type_signed_num: m_val.hArray=new std::vector(*(std::vector*)rSrc.m_val.hArray); break; - case prop_type::type_unsigned_num: + case type_unsigned_num: m_val.hArray=new std::vector(*(std::vector*)rSrc.m_val.hArray); break; - case prop_type::type_bool: + case type_bool: m_val.hArray=new std::vector(*(std::vector*)rSrc.m_val.hArray); break; default: @@ -87,28 +87,28 @@ else { // source property is normal value - switch(rSrc.m_uiPropType & prop_mask::mask_type) + switch(rSrc.m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: { m_val.pszVal=copy_string(rSrc.m_val.pszVal); break; } - case prop_type::type_signed_num: + case type_signed_num: { m_val.llVal=rSrc.m_val.llVal; m_range.ll.llHi=rSrc.m_range.ll.llHi; m_range.ll.llLo=rSrc.m_range.ll.llLo; break; } - case prop_type::type_unsigned_num: + case type_unsigned_num: { m_val.ullVal=rSrc.m_val.ullVal; m_range.ull.ullHi=rSrc.m_range.ull.ullHi; m_range.ull.ullLo=rSrc.m_range.ull.ullLo; break; } - case prop_type::type_bool: + case type_bool: { m_val.bVal=rSrc.m_val.bVal; break; @@ -137,7 +137,7 @@ clear_value(); // reset other members - m_uiPropType=prop_type::type_unknown | prop_flags::flag_none; + m_uiPropType=type_unknown | flag_none; } /** Initializes the property for storaging of the specific property @@ -158,24 +158,24 @@ m_uiPropType=uiType; // and alloc memory for the array property types - if (uiType & prop_flags::flag_array) + if (uiType & flag_array) { - switch(uiType & prop_mask::mask_type) + switch(uiType & mask_type) { - case prop_type::type_string: + case type_string: m_val.hArray=(ptr_t)new std::vector; break; - case prop_type::type_signed_num: + case type_signed_num: m_val.hArray=(ptr_t)new std::vector; m_range.ll.llLo=_I64_MIN; m_range.ll.llHi=_I64_MAX; break; - case prop_type::type_unsigned_num: + case type_unsigned_num: m_val.hArray=(ptr_t)new std::vector; m_range.ull.ullLo=0; m_range.ull.ullHi=_UI64_MAX; break; - case prop_type::type_bool: + case type_bool: m_val.hArray=(ptr_t)new std::vector; break; default: @@ -184,16 +184,16 @@ } else { - switch(uiType & prop_mask::mask_type) + switch(uiType & mask_type) { - case prop_type::type_string: - case prop_type::type_bool: + case type_string: + case type_bool: break; - case prop_type::type_signed_num: + case type_signed_num: m_range.ll.llLo=_I64_MIN; m_range.ll.llHi=_I64_MAX; break; - case prop_type::type_unsigned_num: + case type_unsigned_num: m_range.ull.ullLo=0; m_range.ull.ullHi=_UI64_MAX; break; @@ -215,26 +215,26 @@ */ void property::set_value(const tchar_t* pszValue, actions a, size_t tIndex) { - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: { switch(a) { - case actions::action_replace: + case action_replace: { m_paStrings->clear(); m_paStrings->push_back(tstring(pszValue)); break; } - case actions::action_add: + case action_add: { m_paStrings->push_back(tstring(pszValue)); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paStrings->size()); @@ -247,22 +247,22 @@ } break; } - case prop_type::type_bool: + case type_bool: { switch(a) { - case actions::action_replace: + case action_replace: { m_paBools->clear(); m_paBools->push_back(bool_from_string(pszValue)); break; } - case actions::action_add: + case action_add: { m_paBools->push_back(bool_from_string(pszValue)); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paBools->size()); @@ -275,22 +275,22 @@ } break; } - case prop_type::type_signed_num: + case type_signed_num: { switch(a) { - case actions::action_replace: + case action_replace: { m_paSigneds->clear(); m_paSigneds->push_back(signed_from_string(pszValue)); break; } - case actions::action_add: + case action_add: { m_paSigneds->push_back(signed_from_string(pszValue)); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paSigneds->size()); @@ -303,22 +303,22 @@ } break; } - case prop_type::type_unsigned_num: + case type_unsigned_num: { switch(a) { - case actions::action_replace: + case action_replace: { m_paUnsigneds->clear(); m_paUnsigneds->push_back(unsigned_from_string(pszValue)); break; } - case actions::action_add: + case action_add: { m_paUnsigneds->push_back(unsigned_from_string(pszValue)); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paUnsigneds->size()); @@ -335,25 +335,25 @@ } else { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: { delete [] m_val.pszVal; m_val.pszVal=copy_string(pszValue); break; } - case prop_type::type_signed_num: + case type_signed_num: { m_val.llVal=signed_from_string(pszValue); break; } - case prop_type::type_unsigned_num: + case type_unsigned_num: { m_val.ullVal=unsigned_from_string(pszValue); break; } - case prop_type::type_bool: + case type_bool: { m_val.bVal=bool_from_string(pszValue); break; @@ -379,23 +379,23 @@ { assert(pszString); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: assert(stIndex < m_paStrings->size()); return m_paStrings->at(stIndex).c_str(); break; - case prop_type::type_signed_num: + case type_signed_num: assert(stIndex < m_paSigneds->size()); _sntprintf(pszString, stMaxSize, LLFMT, m_paSigneds->at(stIndex)); break; - case prop_type::type_unsigned_num: + case type_unsigned_num: assert(stIndex < m_paUnsigneds->size()); _sntprintf(pszString, stMaxSize, ULLFMT, m_paUnsigneds->at(stIndex)); break; - case prop_type::type_bool: + case type_bool: assert(stIndex < m_paBools->size()); _sntprintf(pszString, stMaxSize, USFMT, (ushort_t)m_paBools->at(stIndex)); break; @@ -405,18 +405,18 @@ } else { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: return m_val.pszVal; break; - case prop_type::type_signed_num: + case type_signed_num: _sntprintf(pszString, stMaxSize, LLFMT, m_val.llVal); break; - case prop_type::type_unsigned_num: + case type_unsigned_num: _sntprintf(pszString, stMaxSize, ULLFMT, m_val.ullVal); break; - case prop_type::type_bool: + case type_bool: _sntprintf(pszString, stMaxSize, USFMT, (ushort_t)m_val.bVal); break; default: @@ -436,24 +436,24 @@ */ void property::set_string(const tchar_t* pszValue, actions a, size_t tIndex) { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_string); + assert((m_uiPropType & mask_type) == type_string); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { switch(a) { - case actions::action_replace: + case action_replace: { m_paStrings->clear(); m_paStrings->push_back(tstring(pszValue)); break; } - case actions::action_add: + case action_add: { m_paStrings->push_back(tstring(pszValue)); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paStrings->size()); tstring& str=m_paStrings->at(tIndex); @@ -479,9 +479,9 @@ */ const tchar_t* property::get_string(size_t stIndex) const { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_string); + assert((m_uiPropType & mask_type) == type_string); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { assert(stIndex < m_paStrings->size()); return m_paStrings->at(stIndex).c_str(); @@ -499,24 +499,24 @@ */ void property::set_signed_num(ll_t llValue, actions a, size_t tIndex) { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_signed_num); + assert((m_uiPropType & mask_type) == type_signed_num); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { switch(a) { - case actions::action_replace: + case action_replace: { m_paSigneds->clear(); m_paSigneds->push_back(llValue); break; } - case actions::action_add: + case action_add: { m_paSigneds->push_back(llValue); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paSigneds->size()); ll_t& ll=m_paSigneds->at(tIndex); @@ -540,7 +540,7 @@ */ void property::set_signed_range(ll_t llMin, ll_t llMax) { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_signed_num); + assert((m_uiPropType & mask_type) == type_signed_num); // set new range m_range.ll.llLo=llMin; @@ -558,9 +558,9 @@ */ ll_t property::get_signed_num(size_t stIndex) const { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_signed_num); + assert((m_uiPropType & mask_type) == type_signed_num); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { assert(stIndex < m_paSigneds->size()); return m_paSigneds->at(stIndex); @@ -578,24 +578,24 @@ */ void property::set_unsigned_num(ull_t ullValue, actions a, size_t tIndex) { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_unsigned_num); + assert((m_uiPropType & mask_type) == type_unsigned_num); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { switch(a) { - case actions::action_replace: + case action_replace: { m_paUnsigneds->clear(); m_paUnsigneds->push_back(ullValue); break; } - case actions::action_add: + case action_add: { m_paUnsigneds->push_back(ullValue); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paUnsigneds->size()); ull_t& ull=m_paUnsigneds->at(tIndex); @@ -619,7 +619,7 @@ */ void property::set_unsigned_range(ull_t ullMin, ull_t ullMax) { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_unsigned_num); + assert((m_uiPropType & mask_type) == type_unsigned_num); // set new range m_range.ull.ullLo=ullMin; @@ -637,9 +637,9 @@ */ ull_t property::get_unsigned_num(size_t stIndex) const { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_unsigned_num); + assert((m_uiPropType & mask_type) == type_unsigned_num); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { assert(stIndex < m_paUnsigneds->size()); return m_paUnsigneds->at(stIndex); @@ -657,24 +657,24 @@ */ void property::set_bool(bool bValue, actions a, size_t tIndex) { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_bool); + assert((m_uiPropType & mask_type) == type_bool); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { switch(a) { - case actions::action_replace: + case action_replace: { m_paBools->clear(); m_paBools->push_back(bValue); break; } - case actions::action_add: + case action_add: { m_paBools->push_back(bValue); break; } - case actions::action_setat: + case action_setat: { assert(tIndex < m_paBools->size()); std::vector::iterator it=m_paBools->begin()+tIndex; @@ -697,9 +697,9 @@ */ bool property::get_bool(size_t stIndex) const { - assert((m_uiPropType & prop_mask::mask_type) == prop_type::type_bool); + assert((m_uiPropType & mask_type) == type_bool); - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { assert(stIndex < m_paBools->size()); return m_paBools->at(stIndex); @@ -714,17 +714,17 @@ */ size_t property::get_count() const { - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: return m_paStrings->size(); - case prop_type::type_signed_num: + case type_signed_num: return m_paSigneds->size(); - case prop_type::type_unsigned_num: + case type_unsigned_num: return m_paUnsigneds->size(); - case prop_type::type_bool: + case type_bool: return m_paBools->size(); default: assert(false); // unhandled property type @@ -741,29 +741,29 @@ */ void property::remove(size_t stIndex) { - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: { assert(stIndex < m_paStrings->size()); m_paStrings->erase(m_paStrings->begin()+stIndex); break; } - case prop_type::type_signed_num: + case type_signed_num: { assert(stIndex < m_paSigneds->size()); m_paSigneds->erase(m_paSigneds->begin()+stIndex); break; } - case prop_type::type_unsigned_num: + case type_unsigned_num: { assert(stIndex < m_paUnsigneds->size()); m_paUnsigneds->erase(m_paUnsigneds->begin()+stIndex); break; } - case prop_type::type_bool: + case type_bool: { assert(stIndex < m_paBools->size()); m_paBools->erase(m_paBools->begin()+stIndex); @@ -781,20 +781,20 @@ */ void property::clear_array() { - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: m_paStrings->clear(); break; - case prop_type::type_signed_num: + case type_signed_num: m_paSigneds->clear(); break; - case prop_type::type_unsigned_num: + case type_unsigned_num: m_paUnsigneds->clear(); break; - case prop_type::type_bool: + case type_bool: m_paBools->clear(); break; default: @@ -809,20 +809,20 @@ */ void property::clear_value() { - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: delete m_paStrings; break; - case prop_type::type_signed_num: + case type_signed_num: delete m_paSigneds; break; - case prop_type::type_unsigned_num: + case type_unsigned_num: delete m_paUnsigneds; break; - case prop_type::type_bool: + case type_bool: delete m_paBools; break; default: @@ -833,19 +833,19 @@ } else { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_string: + case type_string: delete [] m_val.pszVal; m_val.pszVal=NULL; break; - case prop_type::type_signed_num: + case type_signed_num: m_val.llVal=0LL; break; - case prop_type::type_unsigned_num: + case type_unsigned_num: m_val.ullVal=0ULL; break; - case prop_type::type_bool: + case type_bool: m_val.bVal=false; break; default: @@ -859,11 +859,11 @@ */ void property::check_range() { - if (m_uiPropType & prop_flags::flag_array) + if (m_uiPropType & flag_array) { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_signed_num: + case type_signed_num: { for (std::vector::iterator it=m_paSigneds->begin();it != m_paSigneds->end();it++) { @@ -874,7 +874,7 @@ } break; } - case prop_type::type_unsigned_num: + case type_unsigned_num: { for (std::vector::iterator it=m_paUnsigneds->begin();it != m_paUnsigneds->end();it++) { @@ -889,9 +889,9 @@ } else { - switch(m_uiPropType & prop_mask::mask_type) + switch(m_uiPropType & mask_type) { - case prop_type::type_signed_num: + case type_signed_num: { // check range if (m_val.llVal < m_range.ll.llLo) @@ -900,7 +900,7 @@ m_val.llVal=m_range.ll.llHi; break; } - case prop_type::type_unsigned_num: + case type_unsigned_num: { // check range if (m_val.ullVal < m_range.ull.ullLo) Index: ext/libicpf/src/config_property.h =================================================================== diff -u -N -r0d9a4d94a98872815d5840d1bcc4d394d455307c -rfd1f0cf4d6ad9ff63fd9252a3f2f31c992431842 --- ext/libicpf/src/config_property.h (.../config_property.h) (revision 0d9a4d94a98872815d5840d1bcc4d394d455307c) +++ ext/libicpf/src/config_property.h (.../config_property.h) (revision fd1f0cf4d6ad9ff63fd9252a3f2f31c992431842) @@ -67,47 +67,47 @@ /// Retrieves a property type (with flags) uint_t get_type() const { return m_uiPropType; }; /// Checks if the property is array-based - bool is_array() const { return (m_uiPropType & prop_flags::flag_array) != false; }; + bool is_array() const { return (m_uiPropType & flag_array) != false; }; /// Sets a property name void set_name(const tchar_t* pszName) { m_pszName=copy_string(pszName); }; /// Gets a property name const tchar_t* get_name() const { return m_pszName; }; /// Sets the modified flag - void set_modified(bool bModified) { if (bModified) m_uiPropType |= prop_flags::flag_modified; else m_uiPropType &= ~prop_flags::flag_modified; }; + void set_modified(bool bModified) { if (bModified) m_uiPropType |= flag_modified; else m_uiPropType &= ~flag_modified; }; /// Gets the modified flag - bool is_modified() const { return (m_uiPropType & prop_flags::flag_modified) != false; }; + bool is_modified() const { return (m_uiPropType & flag_modified) != false; }; /**@}*/ /** \brief Property values */ /**@{*/ /// Sets a value from string - void set_value(const tchar_t* pszValue, actions a=actions::action_replace, size_t tIndex=0); + void set_value(const tchar_t* pszValue, actions a=action_replace, size_t tIndex=0); /// Gets the value as string const tchar_t* get_value(tchar_t* pszString, size_t stMaxSize, size_t stIndex=0); /// Sets the string value - void set_string(const tchar_t* pszValue, actions a=actions::action_replace, size_t tIndex=0); + void set_string(const tchar_t* pszValue, actions a=action_replace, size_t tIndex=0); /// Gets the string value const tchar_t* get_string(size_t stIndex=0) const; /// Sets the signed number value - void set_signed_num(ll_t llValue, actions a=actions::action_replace, size_t tIndex=0); + void set_signed_num(ll_t llValue, actions a=action_replace, size_t tIndex=0); /// Sets the signed number range void set_signed_range(ll_t llMin, ll_t llMax); /// Gets the signed number value ll_t get_signed_num(size_t stIndex=0) const; /// Sets the unsigned number value - void set_unsigned_num(ull_t ullValue, actions a=actions::action_replace, size_t tIndex=0); + void set_unsigned_num(ull_t ullValue, actions a=action_replace, size_t tIndex=0); /// Sets the unsigned number range void set_unsigned_range(ull_t ullMin, ull_t ullMax); /// Gets the unsigned number value ull_t get_unsigned_num(size_t stIndex=0) const; /// Sets the bool value - void set_bool(bool bValue, actions a=actions::action_replace, size_t tIndex=0); + void set_bool(bool bValue, actions a=action_replace, size_t tIndex=0); /// Gets the bool value bool get_bool(size_t stIndex=0) const;