Index: src/common/TShellExtMenuConfig.cpp =================================================================== diff -u -r633a533cb6e741d44fe28aa56339e1d2709b1b27 -r960167a493c3ae7ecbdc7e8c2b91619106d7a685 --- src/common/TShellExtMenuConfig.cpp (.../TShellExtMenuConfig.cpp) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) +++ src/common/TShellExtMenuConfig.cpp (.../TShellExtMenuConfig.cpp) (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -25,6 +25,7 @@ #include "../libchcore/TConfig.h" #include #include +#include "../libchcore/TConfigArray.h" // helper method for concatenating strings PCTSTR Concat(std::wstring& wstrBuffer, PCTSTR pszFirst, PCTSTR pszSecond) Index: src/libchcore/TConfig.cpp =================================================================== diff -u -r2ddc2ce53281e95e7571d8ad6232020b74a03429 -r960167a493c3ae7ecbdc7e8c2b91619106d7a685 --- src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 2ddc2ce53281e95e7571d8ad6232020b74a03429) +++ src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -28,52 +28,18 @@ #include "../libicpf/exception.h" #include "TBinarySerializer.h" #include "SerializationHelpers.h" +#include "TConfigArray.h" #pragma warning(push) #pragma warning(disable: 4702 4512) #include #pragma warning(pop) #include #include +#include "TConfigNotifier.h" BEGIN_CHCORE_NAMESPACE -/////////////////////////////////////////////////////////////////////////////////////////////// -// class TConfigNotifier - -TConfigNotifier::TConfigNotifier(void (*pfnCallback)(const TStringSet&, void*), void* pParam) : - m_pfnCallback(pfnCallback), - m_pParam(pParam) -{ -} - -TConfigNotifier::~TConfigNotifier() -{ -} - -void TConfigNotifier::operator()(const TStringSet& rsetPropNames) -{ - if(!m_pfnCallback) - THROW(_T("Invalid pointer"), 0, 0, 0); - - (*m_pfnCallback)(rsetPropNames, m_pParam); -} - -TConfigNotifier& TConfigNotifier::operator=(const TConfigNotifier& rNotifier) -{ - if(this != &rNotifier) - { - m_pfnCallback = rNotifier.m_pfnCallback; - m_pParam = rNotifier.m_pParam; - } - return *this; -} - -bool TConfigNotifier::operator==(const TConfigNotifier& rNotifier) const -{ - return m_pfnCallback == rNotifier.m_pfnCallback/* && m_pParam == rNotifier.m_pParam*/; -} - ///////////////////////////////////////////////////////////////////////////////////////////// // common set/get templates template @@ -110,67 +76,6 @@ } ///////////////////////////////////////////////////////////////////////////////////////////// -// class TConfigArray - -TConfigArray::TConfigArray() -{ -} - -TConfigArray::TConfigArray(const TConfigArray& rSrc) : - m_vConfigs(rSrc.m_vConfigs) -{ -} - -TConfigArray::~TConfigArray() -{ -} - -TConfigArray& TConfigArray::operator=(const TConfigArray& rSrc) -{ - if(this != &rSrc) - { - m_vConfigs = rSrc.m_vConfigs; - } - - return *this; -} - -size_t TConfigArray::GetCount() const -{ - return m_vConfigs.size(); -} - -bool TConfigArray::IsEmpty() const -{ - return m_vConfigs.empty(); -} - -const TConfig& TConfigArray::GetAt(size_t stIndex) const -{ - return m_vConfigs[stIndex]; -} - -TConfig& TConfigArray::GetAt(size_t stIndex) -{ - return m_vConfigs[stIndex]; -} - -void TConfigArray::Add(const TConfig& rSrc) -{ - m_vConfigs.push_back(rSrc); -} - -void TConfigArray::RemoveAt(size_t stIndex) -{ - m_vConfigs.erase(m_vConfigs.begin() + stIndex); -} - -void TConfigArray::Clear() -{ - m_vConfigs.clear(); -} - -///////////////////////////////////////////////////////////////////////////////////////////// // class TConfig TConfig::TConfig() : Index: src/libchcore/TConfig.h =================================================================== diff -u -r5fd6beaad9f1eccb664b997d151acb59961e4827 -r960167a493c3ae7ecbdc7e8c2b91619106d7a685 --- src/libchcore/TConfig.h (.../TConfig.h) (revision 5fd6beaad9f1eccb664b997d151acb59961e4827) +++ src/libchcore/TConfig.h (.../TConfig.h) (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -36,53 +36,8 @@ class TReadBinarySerializer; class TWriteBinarySerializer; -// class defines configuration change notification record; not to be used outside -class TConfigNotifier -{ -public: - TConfigNotifier(void (*pfnCallback)(const TStringSet&, void*), void* pParam); - ~TConfigNotifier(); +class TConfigArray; - void operator()(const TStringSet& rsetPropNames); - - TConfigNotifier& operator=(const TConfigNotifier& rNotifier); - - bool operator==(const TConfigNotifier& rNotifier) const; - -private: - void (*m_pfnCallback)(const TStringSet&, void*); - void* m_pParam; -}; - -class TConfig; - -class LIBCHCORE_API TConfigArray -{ -public: - TConfigArray(); - TConfigArray(const TConfigArray& rSrc); - ~TConfigArray(); - - TConfigArray& operator=(const TConfigArray& rSrc); - - size_t GetCount() const; - bool IsEmpty() const; - - const TConfig& GetAt(size_t stIndex) const; - TConfig& GetAt(size_t stIndex); - - void Add(const TConfig& rSrc); - - void RemoveAt(size_t stIndex); - void Clear(); - -private: -#pragma warning(push) -#pragma warning(disable: 4251) - std::vector m_vConfigs; -#pragma warning(pop) -}; - // class for handling configuration settings class LIBCHCORE_API TConfig { Index: src/libchcore/TConfigArray.cpp =================================================================== diff -u --- src/libchcore/TConfigArray.cpp (revision 0) +++ src/libchcore/TConfigArray.cpp (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -0,0 +1,86 @@ +// ============================================================================ +// Copyright (C) 2001-2014 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#include "stdafx.h" +#include "TConfigArray.h" + +BEGIN_CHCORE_NAMESPACE + + +///////////////////////////////////////////////////////////////////////////////////////////// +// class TConfigArray + +TConfigArray::TConfigArray() +{ +} + +TConfigArray::TConfigArray(const TConfigArray& rSrc) : +m_vConfigs(rSrc.m_vConfigs) +{ +} + +TConfigArray::~TConfigArray() +{ +} + +TConfigArray& TConfigArray::operator=(const TConfigArray& rSrc) +{ + if(this != &rSrc) + { + m_vConfigs = rSrc.m_vConfigs; + } + + return *this; +} + +size_t TConfigArray::GetCount() const +{ + return m_vConfigs.size(); +} + +bool TConfigArray::IsEmpty() const +{ + return m_vConfigs.empty(); +} + +const TConfig& TConfigArray::GetAt(size_t stIndex) const +{ + return m_vConfigs[stIndex]; +} + +TConfig& TConfigArray::GetAt(size_t stIndex) +{ + return m_vConfigs[stIndex]; +} + +void TConfigArray::Add(const TConfig& rSrc) +{ + m_vConfigs.push_back(rSrc); +} + +void TConfigArray::RemoveAt(size_t stIndex) +{ + m_vConfigs.erase(m_vConfigs.begin() + stIndex); +} + +void TConfigArray::Clear() +{ + m_vConfigs.clear(); +} + +END_CHCORE_NAMESPACE Index: src/libchcore/TConfigArray.h =================================================================== diff -u --- src/libchcore/TConfigArray.h (revision 0) +++ src/libchcore/TConfigArray.h (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -0,0 +1,56 @@ +// ============================================================================ +// Copyright (C) 2001-2014 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#ifndef __TCONFIGARRAY_H__ +#define __TCONFIGARRAY_H__ + +#include "libchcore.h" +#include "TConfig.h" + +BEGIN_CHCORE_NAMESPACE + +class LIBCHCORE_API TConfigArray +{ +public: + TConfigArray(); + TConfigArray(const TConfigArray& rSrc); + ~TConfigArray(); + + TConfigArray& operator=(const TConfigArray& rSrc); + + size_t GetCount() const; + bool IsEmpty() const; + + const TConfig& GetAt(size_t stIndex) const; + TConfig& GetAt(size_t stIndex); + + void Add(const TConfig& rSrc); + + void RemoveAt(size_t stIndex); + void Clear(); + +private: +#pragma warning(push) +#pragma warning(disable: 4251) + std::vector m_vConfigs; +#pragma warning(pop) +}; + +END_CHCORE_NAMESPACE + +#endif Index: src/libchcore/TConfigNotifier.cpp =================================================================== diff -u --- src/libchcore/TConfigNotifier.cpp (revision 0) +++ src/libchcore/TConfigNotifier.cpp (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -0,0 +1,62 @@ +// ============================================================================ +// Copyright (C) 2001-2014 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#include "stdafx.h" +#include "TConfigNotifier.h" +#include "TCoreException.h" +#include "ErrorCodes.h" + +BEGIN_CHCORE_NAMESPACE + +/////////////////////////////////////////////////////////////////////////////////////////////// +// class TConfigNotifier + +TConfigNotifier::TConfigNotifier(void (*pfnCallback)(const TStringSet&, void*), void* pParam) : + m_pfnCallback(pfnCallback), + m_pParam(pParam) +{ +} + +TConfigNotifier::~TConfigNotifier() +{ +} + +void TConfigNotifier::operator()(const TStringSet& rsetPropNames) +{ + if(!m_pfnCallback) + THROW_CORE_EXCEPTION(eErr_InvalidPointer); + + (*m_pfnCallback)(rsetPropNames, m_pParam); +} + +TConfigNotifier& TConfigNotifier::operator=(const TConfigNotifier& rNotifier) +{ + if(this != &rNotifier) + { + m_pfnCallback = rNotifier.m_pfnCallback; + m_pParam = rNotifier.m_pParam; + } + return *this; +} + +bool TConfigNotifier::operator==(const TConfigNotifier& rNotifier) const +{ + return m_pfnCallback == rNotifier.m_pfnCallback/* && m_pParam == rNotifier.m_pParam*/; +} + +END_CHCORE_NAMESPACE Index: src/libchcore/TConfigNotifier.h =================================================================== diff -u --- src/libchcore/TConfigNotifier.h (revision 0) +++ src/libchcore/TConfigNotifier.h (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -0,0 +1,47 @@ +// ============================================================================ +// Copyright (C) 2001-2014 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#ifndef __TCONFIGNOTIFIER_H__ +#define __TCONFIGNOTIFIER_H__ + +#include "libchcore.h" +#include "TStringSet.h" + +BEGIN_CHCORE_NAMESPACE + +// class defines configuration change notification record; not to be used outside +class TConfigNotifier +{ +public: + TConfigNotifier(void (*pfnCallback)(const TStringSet&, void*), void* pParam); + ~TConfigNotifier(); + + void operator()(const TStringSet& rsetPropNames); + + TConfigNotifier& operator=(const TConfigNotifier& rNotifier); + + bool operator==(const TConfigNotifier& rNotifier) const; + +private: + void (*m_pfnCallback)(const TStringSet&, void*); + void* m_pParam; +}; + +END_CHCORE_NAMESPACE + +#endif Index: src/libchcore/TFileFiltersArray.cpp =================================================================== diff -u -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r960167a493c3ae7ecbdc7e8c2b91619106d7a685 --- src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TFileFiltersArray.cpp (.../TFileFiltersArray.cpp) (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -22,6 +22,7 @@ #include "TConfig.h" #include "TBinarySerializer.h" #include "SerializationHelpers.h" +#include "TConfigArray.h" BEGIN_CHCORE_NAMESPACE Index: src/libchcore/libchcore.vc90.vcproj =================================================================== diff -u -ra5aa3c3cb78f3767641de2627d1a49a1dc35b429 -r960167a493c3ae7ecbdc7e8c2b91619106d7a685 --- src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision a5aa3c3cb78f3767641de2627d1a49a1dc35b429) +++ src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision 960167a493c3ae7ecbdc7e8c2b91619106d7a685) @@ -1032,14 +1032,6 @@ > - - - - @@ -1283,6 +1275,34 @@ > + + + + + + + + + + + + + +