diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-17 15:56:52 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-17 15:56:52 +0300 |
commit | 3e05d92dcb5f6c2017bc462554901ba27816bdb4 (patch) | |
tree | 3276a7c3527006b74afc00c197ab48a3a43b1e9e /plugins | |
parent | e285d61d903c2616f5a7ea3026a1068ceb59b513 (diff) |
MNonCopyable - the common class to avoid declaring fake private constructors
Diffstat (limited to 'plugins')
31 files changed, 63 insertions, 104 deletions
diff --git a/plugins/Boltun/src/Engine/PerContactData.h b/plugins/Boltun/src/Engine/PerContactData.h index f573423bd3..5eb276ab28 100644 --- a/plugins/Boltun/src/Engine/PerContactData.h +++ b/plugins/Boltun/src/Engine/PerContactData.h @@ -24,10 +24,8 @@ static std::map<unsigned, void*> perContactDataObjects;
template <class Source, class Data, class ContactHandle>
-class PerContactData
+class PerContactData : private MNonCopyable
{
- PerContactData& operator=(const PerContactData&);
-
template <class Source, class Data>
struct InternalData
{
diff --git a/plugins/Boltun/src/Engine/TalkEngine.h b/plugins/Boltun/src/Engine/TalkEngine.h index 3ddeaf87b9..cd54199a90 100644 --- a/plugins/Boltun/src/Engine/TalkEngine.h +++ b/plugins/Boltun/src/Engine/TalkEngine.h @@ -26,9 +26,8 @@ #include "PerContactData.h"
#include "UnrecentChooser.h"
-class TalkBot
+class TalkBot : private MNonCopyable
{
- TalkBot& operator=(const TalkBot&);
public:
struct MessageInfo
diff --git a/plugins/Boltun/src/Engine/ValueChooser.h b/plugins/Boltun/src/Engine/ValueChooser.h index e442f14530..6ddfc00a5a 100644 --- a/plugins/Boltun/src/Engine/ValueChooser.h +++ b/plugins/Boltun/src/Engine/ValueChooser.h @@ -22,7 +22,7 @@ #define StringChooserH
template<class container = std::vector<std::wstring> >
-class ValueChooser
+class ValueChooser : private MNonCopyable
{
private:
int freeNumbers;
@@ -30,8 +30,6 @@ private: const container data;
bool notifyOnReset;
- ValueChooser& operator=(const ValueChooser&);
-
public:
ValueChooser(const container& vec, bool NotifyOnReset = false)
:data(vec), notifyOnReset(NotifyOnReset)
diff --git a/plugins/Boltun/src/config.h b/plugins/Boltun/src/config.h index eeb697d4b0..b7b4243963 100644 --- a/plugins/Boltun/src/config.h +++ b/plugins/Boltun/src/config.h @@ -24,7 +24,7 @@ class BoltunConfig;
template <class T, class BaseClass>
-class Property
+class Property : private MNonCopyable
{
public:
typedef const T(__thiscall BaseClass::*Getter)();
@@ -37,8 +37,6 @@ private: bool cacheValid;
T cached;
- Property& operator=(const Property&);
-
public:
Property(Getter g, Setter s)
:getter(g), setter(s), cacheValid(false)
@@ -67,7 +65,7 @@ public: };
template <class T, class BaseClass>
-class PtrProperty
+class PtrProperty : private MNonCopyable
{
public:
typedef const T* (__thiscall BaseClass::*Getter)();
@@ -80,8 +78,6 @@ private: bool cacheValid;
const T* cached;
- PtrProperty& operator=(const PtrProperty&);
-
public:
PtrProperty(Getter g, Setter s)
:getter(g), setter(s), cacheValid(false), cached(nullptr)
diff --git a/plugins/ClientChangeNotify/src/CString.cpp b/plugins/ClientChangeNotify/src/CString.cpp index 2ed5f49062..d664213498 100644 --- a/plugins/ClientChangeNotify/src/CString.cpp +++ b/plugins/ClientChangeNotify/src/CString.cpp @@ -253,7 +253,7 @@ TString<T> TString<T>::ToLower() const template <class T>
-TString<T>& TString<T>::operator = (const T *pStr)
+TString<T>& TString<T>::operator=(const T *pStr)
{
if (pStr)
{
diff --git a/plugins/ClientChangeNotify/src/CString.h b/plugins/ClientChangeNotify/src/CString.h index decedaaac7..38d6080fba 100644 --- a/plugins/ClientChangeNotify/src/CString.h +++ b/plugins/ClientChangeNotify/src/CString.h @@ -68,16 +68,16 @@ public: T& operator [] (int nIndex) {_ASSERT(nIndex >= 0 && nIndex <= GetLen()); return pBuf[nIndex];}
operator const T*() const {return pBuf;}
operator T*() {return pBuf;}
- TString<T>& operator = (const T *pStr);
- TString<T>& operator = (const TString<T> &Str) {return *this = Str.pBuf;}
+ TString<T>& operator=(const T *pStr);
+ TString<T>& operator=(const TString<T> &Str) {return *this = Str.pBuf;}
// TCString& operator + (const char *pStr)
// {_ASSERT(pBuf && pStr); TCString Result(*this); return Result.Cat(pStr);}
friend TString<T> operator + (const TString<T> &Str1, const T *Str2)
{_ASSERT(Str1.pBuf && Str2); TString<T> Result(Str1); return Result.Cat(Str2);}
/* friend TCString operator + (const char *Str1, const TCString &Str2)
{_ASSERT(Str1 && Str2.pBuf); TCString Result(Str1); return Result.Cat(Str2);}*/
- TString<T>& operator += (const T *pStr) {_ASSERT(pBuf && pStr); return this->Cat(pStr);}
- TString<T>& operator += (const T c) {_ASSERT(pBuf); return this->Cat(c);}
+ TString<T>& operator+=(const T *pStr) {_ASSERT(pBuf && pStr); return this->Cat(pStr);}
+ TString<T>& operator+=(const T c) {_ASSERT(pBuf); return this->Cat(c);}
int operator == (const T *pStr) const {return (!pBuf || !pStr) ? (pBuf == pStr) : !My_lstrcmp(pBuf, pStr);}
int operator != (const T *pStr) const {return (!pBuf || !pStr) ? (pBuf != pStr) : My_lstrcmp(pBuf, pStr);}
int operator < (const T *pStr) const {_ASSERT(pBuf && pStr); return My_lstrcmp(pBuf, pStr) > 0;}
diff --git a/plugins/ClientChangeNotify/src/Options.cpp b/plugins/ClientChangeNotify/src/Options.cpp index cc1e3e6d96..e9674592a7 100644 --- a/plugins/ClientChangeNotify/src/Options.cpp +++ b/plugins/ClientChangeNotify/src/Options.cpp @@ -101,7 +101,7 @@ COptItem *COptPage::Find(int m_dlgItemID) return nullptr;
}
-COptPage& COptPage::operator = (const COptPage& Page)
+COptPage& COptPage::operator=(const COptPage& Page)
{
hWnd = Page.hWnd;
sModule = Page.sModule;
diff --git a/plugins/ClientChangeNotify/src/Options.h b/plugins/ClientChangeNotify/src/Options.h index aac3e9d1c0..35f62f817c 100644 --- a/plugins/ClientChangeNotify/src/Options.h +++ b/plugins/ClientChangeNotify/src/Options.h @@ -61,7 +61,6 @@ public: int GetParam() { return lParam; }
int GetID() { return m_dlgItemID; }
- // virtual COptItem& operator = (const COptItem& Item) {return *this;};
virtual COptItem* Copy() { _ASSERT(0); return NULL; } // Attention! Free Copy() result when it's not needed anymore!
CString sDBSetting;
@@ -107,7 +106,6 @@ public: virtual INT_PTR GetValue() { return (INT_PTR)&sValue; }
virtual INT_PTR GetDefValue() { return (INT_PTR)&sDefValue; }
- // COptItem_Edit& operator = (const COptItem_Edit& Item) {return *this;};
virtual COptItem* Copy() { return new COptItem_Edit(*this); }
TCString sDefValue;
@@ -524,7 +522,7 @@ public: bool GetModified();
void SetModified(bool m_bModified);
- COptPage& operator = (const COptPage& Page);
+ COptPage& operator=(const COptPage& Page);
HWND hWnd;
CString sModule, sDBSettingPrefix;
diff --git a/plugins/ClientChangeNotify/src/TMyArray.h b/plugins/ClientChangeNotify/src/TMyArray.h index 3e676bf816..27bff9fd44 100644 --- a/plugins/ClientChangeNotify/src/TMyArray.h +++ b/plugins/ClientChangeNotify/src/TMyArray.h @@ -49,8 +49,8 @@ public: void RemoveAll();
const T& operator[](int nIndex) const;
T& operator[](int nIndex);
- TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator = (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
- TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator += (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
+ TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
+ TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator+=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
private:
int SetAllocNum(int nNewAllocNum);
@@ -328,7 +328,7 @@ __forceinline T& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator[](int nInde }
template <class T, class ARG_T, int GrowBy, int FreeThreshold>
-__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator = (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
+__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
{
RemoveAll();
int I;
@@ -340,7 +340,7 @@ __forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, Grow }
template <class T, class ARG_T, int GrowBy, int FreeThreshold>
-__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator += (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
+__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator+=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
{
int I;
for (I = 0; I < A.GetSize(); I++)
diff --git a/plugins/NewAwaySysMod/src/CString.cpp b/plugins/NewAwaySysMod/src/CString.cpp index 5a61b36edb..60b9ac0985 100644 --- a/plugins/NewAwaySysMod/src/CString.cpp +++ b/plugins/NewAwaySysMod/src/CString.cpp @@ -252,7 +252,7 @@ TString<T> TString<T>::ToLower() const template <class T>
-TString<T>& TString<T>::operator = (const T *pStr)
+TString<T>& TString<T>::operator=(const T *pStr)
{
if (pStr)
{
diff --git a/plugins/NewAwaySysMod/src/CString.h b/plugins/NewAwaySysMod/src/CString.h index 22cb0dd4c3..e079b740cd 100644 --- a/plugins/NewAwaySysMod/src/CString.h +++ b/plugins/NewAwaySysMod/src/CString.h @@ -68,16 +68,16 @@ public: T& operator [] (int nIndex) {_ASSERT(nIndex >= 0 && nIndex <= GetLen()); return pBuf[nIndex];}
operator const T*() const {return pBuf;}
operator T*() {return pBuf;}
- TString<T>& operator = (const T *pStr);
- TString<T>& operator = (const TString<T> &Str) {return *this = Str.pBuf;}
+ TString<T>& operator=(const T *pStr);
+ TString<T>& operator=(const TString<T> &Str) {return *this = Str.pBuf;}
// TCString& operator + (const char *pStr)
// {_ASSERT(pBuf && pStr); TCString Result(*this); return Result.Cat(pStr);}
friend TString<T> operator + (const TString<T> &Str1, const T *Str2)
{_ASSERT(Str1.pBuf && Str2); TString<T> Result(Str1); return Result.Cat(Str2);}
/* friend TCString operator + (const char *Str1, const TCString &Str2)
{_ASSERT(Str1 && Str2.pBuf); TCString Result(Str1); return Result.Cat(Str2);}*/
- TString<T>& operator += (const T *pStr) {_ASSERT(pBuf && pStr); return this->Cat(pStr);}
- TString<T>& operator += (const T c) {_ASSERT(pBuf); return this->Cat(c);}
+ TString<T>& operator+=(const T *pStr) {_ASSERT(pBuf && pStr); return this->Cat(pStr);}
+ TString<T>& operator+=(const T c) {_ASSERT(pBuf); return this->Cat(c);}
int operator == (const T *pStr) const {return (!pBuf || !pStr) ? (pBuf == pStr) : !My_lstrcmp(pBuf, pStr);}
int operator != (const T *pStr) const {return (!pBuf || !pStr) ? (pBuf != pStr) : My_lstrcmp(pBuf, pStr);}
int operator < (const T *pStr) const {_ASSERT(pBuf && pStr); return My_lstrcmp(pBuf, pStr) > 0;}
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp index f0cac57fb3..37481c2e51 100644 --- a/plugins/NewAwaySysMod/src/Options.cpp +++ b/plugins/NewAwaySysMod/src/Options.cpp @@ -101,7 +101,7 @@ COptItem *COptPage::Find(int m_dlgItemID) return nullptr;
}
-COptPage& COptPage::operator = (const COptPage& Page)
+COptPage& COptPage::operator=(const COptPage& Page)
{
hWnd = Page.hWnd;
sModule = Page.sModule;
diff --git a/plugins/NewAwaySysMod/src/Options.h b/plugins/NewAwaySysMod/src/Options.h index 2b06244c44..129a52a5bd 100644 --- a/plugins/NewAwaySysMod/src/Options.h +++ b/plugins/NewAwaySysMod/src/Options.h @@ -61,7 +61,6 @@ public: int GetParam() { return lParam; }
int GetID() { return m_dlgItemID; }
- // virtual COptItem& operator = (const COptItem& Item) {return *this;};
virtual COptItem* Copy() { _ASSERT(0); return nullptr; } // Attention! Free Copy() result when it's not needed anymore!
CString sDBSetting;
@@ -107,7 +106,6 @@ public: virtual INT_PTR GetValue() { return (INT_PTR)&sValue; }
virtual INT_PTR GetDefValue() { return (INT_PTR)&sDefValue; }
- // COptItem_Edit& operator = (const COptItem_Edit& Item) {return *this;};
virtual COptItem* Copy() { return new COptItem_Edit(*this); }
TCString sDefValue;
@@ -524,7 +522,7 @@ public: bool GetModified();
void SetModified(bool m_bModified);
- COptPage& operator = (const COptPage& Page);
+ COptPage& operator=(const COptPage& Page);
HWND hWnd;
CString sModule, sDBSettingPrefix;
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp index 16bc7a3fbb..077704fb56 100644 --- a/plugins/NewAwaySysMod/src/Properties.cpp +++ b/plugins/NewAwaySysMod/src/Properties.cpp @@ -45,7 +45,7 @@ void ResetSettingsOnStatusChange(const char *szProto = nullptr, int bResetPerson }
-CProtoState::CStatus& CProtoState::CStatus::operator = (int Status)
+CProtoState::CStatus& CProtoState::CStatus::operator=(int Status)
{
_ASSERT(Status >= ID_STATUS_OFFLINE && Status <= ID_STATUS_OUTTOLUNCH);
if (Status < ID_STATUS_OFFLINE || Status > ID_STATUS_OUTTOLUNCH)
diff --git a/plugins/NewAwaySysMod/src/Properties.h b/plugins/NewAwaySysMod/src/Properties.h index 5c7f42d718..f5b2f2d7fb 100644 --- a/plugins/NewAwaySysMod/src/Properties.h +++ b/plugins/NewAwaySysMod/src/Properties.h @@ -153,7 +153,7 @@ public: {
public:
CStatus(const char* szProto, CProtoStates* GrandParent): m_szProto(szProto), m_grandParent(GrandParent), m_status(ID_STATUS_OFFLINE) {}
- CStatus& operator = (int Status);
+ CStatus& operator=(int Status);
operator int() {return m_status;}
friend class CProtoState;
private:
@@ -179,7 +179,7 @@ public: {
public:
CCurStatusMsg() {*this = nullptr;}
- CCurStatusMsg& operator = (TCString Msg)
+ CCurStatusMsg& operator=(TCString Msg)
{
CurStatusMsg = Msg;
SYSTEMTIME st;
@@ -205,7 +205,7 @@ public: { // we use temporary messages to keep user-defined per-protocol messages intact, when changing messages through MS_NAS_SETSTATE, or when autoaway becomes active etc.. temporary messages are automatically resetted when protocol status changes
public:
CTempMsg(): iIsSet(0) {}
- CTempMsg& operator = (TCString _Msg) {this->Msg = _Msg; iIsSet = true; return *this;}
+ CTempMsg& operator=(TCString _Msg) {this->Msg = _Msg; iIsSet = true; return *this;}
operator TCString()
{
_ASSERT(iIsSet);
@@ -242,7 +242,7 @@ public: CProtoStates() {}
CProtoStates(const CProtoStates &States) {*this = States;}
- CProtoStates& operator = (const CProtoStates& States)
+ CProtoStates& operator=(const CProtoStates& States)
{
ProtoStates = States.ProtoStates;
for (int i = 0; i < ProtoStates.GetSize(); i++)
@@ -323,7 +323,7 @@ public: class CAutoreply
{
public:
- CAutoreply& operator = (const int m_value)
+ CAutoreply& operator=(const int m_value)
{
CString Setting(Parent->szProto ? Parent->ProtoStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPROTOSETTINGS) : DB_ENABLEREPLY);
if (db_get_b(NULL, MOD_NAME, Setting, VAL_USEDEFAULT) == m_value)
@@ -357,7 +357,7 @@ public: {
public:
CStatus(int iStatus = 0, const char *szProto = nullptr): Status(iStatus), szProto(szProto) {}
- CStatus& operator = (int _Status) {this->Status = _Status; return *this;}
+ CStatus& operator=(int _Status) {this->Status = _Status; return *this;}
operator int()
{
if (!Status)
@@ -416,7 +416,7 @@ public: class CIgnore
{
public:
- CIgnore& operator = (const int m_value)
+ CIgnore& operator=(const int m_value)
{
CString Setting(Parent->ContactStatusToDBSetting(DB_IGNOREREQUESTS, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
@@ -441,7 +441,7 @@ public: class CAutoreply
{
public:
- CAutoreply& operator = (const int m_value)
+ CAutoreply& operator=(const int m_value)
{
CString Setting(Parent->ContactStatusToDBSetting(DB_ENABLEREPLY, IDC_MOREOPTDLG_PERSTATUSPERSONALSETTINGS));
MCONTACT hContact = (Parent->m_hContact != INVALID_CONTACT_ID) ? Parent->m_hContact : NULL;
@@ -483,7 +483,7 @@ public: {
public:
CStatus(int iStatus = 0, MCONTACT _hContact = NULL): Status(iStatus), m_hContact(_hContact) {}
- CStatus& operator = (int _Status) {this->Status = _Status; return *this;}
+ CStatus& operator=(int _Status) {this->Status = _Status; return *this;}
operator int()
{
if (!Status) {
diff --git a/plugins/NewAwaySysMod/src/TMyArray.h b/plugins/NewAwaySysMod/src/TMyArray.h index 45eeaf1563..7bca17fb68 100644 --- a/plugins/NewAwaySysMod/src/TMyArray.h +++ b/plugins/NewAwaySysMod/src/TMyArray.h @@ -49,8 +49,8 @@ public: void RemoveAll();
const T& operator[](int nIndex) const;
T& operator[](int nIndex);
- TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator = (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
- TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator += (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
+ TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
+ TMyArray<T, ARG_T, GrowBy, FreeThreshold>& operator+=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A);
private:
int SetAllocNum(int nNewAllocNum);
@@ -328,7 +328,7 @@ __forceinline T& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator[](int nInde }
template <class T, class ARG_T, int GrowBy, int FreeThreshold>
-__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator = (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
+__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
{
RemoveAll();
int I;
@@ -340,7 +340,7 @@ __forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, Grow }
template <class T, class ARG_T, int GrowBy, int FreeThreshold>
-__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator += (const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
+__forceinline TMyArray<T, ARG_T, GrowBy, FreeThreshold>& TMyArray<T, ARG_T, GrowBy, FreeThreshold>::operator+=(const TMyArray<T, ARG_T, GrowBy, FreeThreshold> &A)
{
int I;
for (I = 0; I < A.GetSize(); I++)
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h index e3a4f0a354..6a3c73c00a 100644 --- a/plugins/PluginUpdater/src/stdafx.h +++ b/plugins/PluginUpdater/src/stdafx.h @@ -172,10 +172,9 @@ extern IconItemT iconList[]; void UninitCheck(void);
void UninitListNew(void);
-class AutoHandle
+class AutoHandle : private MNonCopyable
{
HANDLE &m_handle;
- AutoHandle& operator=(const AutoHandle&) { return *this; }
public:
AutoHandle(HANDLE &_handle) : m_handle(_handle) {}
diff --git a/plugins/SmileyAdd/src/smileys.h b/plugins/SmileyAdd/src/smileys.h index 4f02daed07..d75d40c418 100644 --- a/plugins/SmileyAdd/src/smileys.h +++ b/plugins/SmileyAdd/src/smileys.h @@ -104,13 +104,13 @@ template<class T> struct SMOBJLIST : public OBJLIST<T> {
SMOBJLIST() : OBJLIST<T>(5) {};
- SMOBJLIST<T>& operator = (const SMOBJLIST<T>& lst)
+ SMOBJLIST<T>& operator=(const SMOBJLIST<T>& lst)
{
OBJLIST<T>::destroy();
- return operator += (lst);
+ return operator+=(lst);
}
- SMOBJLIST<T>& operator += (const SMOBJLIST<T>& lst)
+ SMOBJLIST<T>& operator+=(const SMOBJLIST<T>& lst)
{
for (auto &it : lst)
insert(new T(*it));
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.h b/plugins/UserInfoEx/src/classMAnnivDate.h index 987408cb63..1dcfda6124 100644 --- a/plugins/UserInfoEx/src/classMAnnivDate.h +++ b/plugins/UserInfoEx/src/classMAnnivDate.h @@ -118,6 +118,6 @@ public: BYTE operator == (const SYSTEMTIME &st) { return IsEqual(st); };
BYTE operator == (const MAnnivDate &mda) { return IsEqual(mda); };
- void operator = (SYSTEMTIME &st) { SetDate(st); };
- void operator = (MAnnivDate &mda) { SetDate(mda); };
+ void operator=(SYSTEMTIME &st) { SetDate(st); };
+ void operator=(MAnnivDate &mda) { SetDate(mda); };
};
diff --git a/plugins/UserInfoEx/src/classMTime.h b/plugins/UserInfoEx/src/classMTime.h index 3388611c2f..eff510421a 100644 --- a/plugins/UserInfoEx/src/classMTime.h +++ b/plugins/UserInfoEx/src/classMTime.h @@ -105,11 +105,11 @@ public: int DBWriteStamp(MCONTACT hContact, LPCSTR pszModule, LPCSTR pszSetting);
// operatoren
- void operator = (DWORD& dwTimeStamp) { FromStampAsUTC(dwTimeStamp); };
- void operator = (FILETIME &ftFileTime) { Set(ftFileTime, FALSE); };
- void operator = (LARGE_INTEGER &liFileTime) { Set(liFileTime, FALSE); };
- void operator = (SYSTEMTIME &st) { Set(st, FALSE); };
- void operator = (const MTime &mt) { Set(mt); };
+ void operator=(DWORD& dwTimeStamp) { FromStampAsUTC(dwTimeStamp); };
+ void operator=(FILETIME &ftFileTime) { Set(ftFileTime, FALSE); };
+ void operator=(LARGE_INTEGER &liFileTime) { Set(liFileTime, FALSE); };
+ void operator=(SYSTEMTIME &st) { Set(st, FALSE); };
+ void operator=(const MTime &mt) { Set(mt); };
};
/**
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h index ad89480259..e34d77d338 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.h @@ -83,5 +83,5 @@ public: MCONTACT toDB();
void toIni(FILE* file, int modCount);
- BYTE operator = (MCONTACT hContact) { return fromDB(hContact); }
+ BYTE operator=(MCONTACT hContact) { return fromDB(hContact); }
};
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h index 759f8d756a..7b2a255929 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h @@ -81,7 +81,7 @@ public: int LoadXmlElemnt(TiXmlElement *xContact);
int Import(BYTE keepMetaSubContact = FALSE);
- BYTE operator = (TiXmlElement* xmlContact) {
+ BYTE operator=(TiXmlElement* xmlContact) {
return LoadXmlElemnt(xmlContact) == ERROR_OK;
}
};
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp index eab2949fe4..eda76bb29d 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp @@ -113,7 +113,7 @@ BYTE CLineBuffer::_resizeBuf(const size_t cbReq) *
* return: length of the string, added
**/
-size_t CLineBuffer::operator = (const CHAR *szVal)
+size_t CLineBuffer::operator=(const CHAR *szVal)
{
if (szVal) {
size_t cbLength = mir_strlen(szVal);
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h index 0636d37dd4..7ea59290ce 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.h @@ -35,7 +35,7 @@ public: CLineBuffer();
~CLineBuffer();
- size_t operator = (const CHAR *szVal);
+ size_t operator=(const CHAR *szVal);
size_t operator + (const CHAR *szVal);
size_t operator + (const WCHAR *wszVal);
diff --git a/plugins/UserInfoEx/src/ex_import/tinystr.h b/plugins/UserInfoEx/src/ex_import/tinystr.h index a5d85d11dc..3f5dbf9308 100644 --- a/plugins/UserInfoEx/src/ex_import/tinystr.h +++ b/plugins/UserInfoEx/src/ex_import/tinystr.h @@ -100,32 +100,32 @@ class TiXmlString } // = operator - TiXmlString& operator = (const char * copy) + TiXmlString& operator=(const char * copy) { return assign(copy, (size_type)mir_strlen(copy)); } // = operator - TiXmlString& operator = (const TiXmlString & copy) + TiXmlString& operator=(const TiXmlString & copy) { return assign(copy.start(), copy.length()); } // += operator. Maps to append - TiXmlString& operator += (const char * suffix) + TiXmlString& operator+=(const char * suffix) { return append(suffix, static_cast<size_type>(mir_strlen(suffix))); } // += operator. Maps to append - TiXmlString& operator += (char single) + TiXmlString& operator+=(char single) { return append(&single, 1); } // += operator. Maps to append - TiXmlString& operator += (const TiXmlString & suffix) + TiXmlString& operator+=(const TiXmlString & suffix) { return append(suffix.data(), suffix.length()); } diff --git a/plugins/UserInfoEx/src/ex_import/tinyxml.h b/plugins/UserInfoEx/src/ex_import/tinyxml.h index ac98ee8d74..dc9087cc8c 100644 --- a/plugins/UserInfoEx/src/ex_import/tinyxml.h +++ b/plugins/UserInfoEx/src/ex_import/tinyxml.h @@ -151,7 +151,7 @@ const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN; #include "ticpprc.h" class TiXmlBase : public TiCppRC #else -class TiXmlBase +class TiXmlBase : private MNonCopyable #endif { friend class TiXmlNode; @@ -366,9 +366,6 @@ protected: static void ConvertUTF32ToUTF8(unsigned long input, char* output, int* length); private: - TiXmlBase(const TiXmlBase&); // not implemented. - void operator=(const TiXmlBase& base); // not allowed. - struct Entity { const char* str; @@ -392,7 +389,7 @@ private: in a document, or stand on its own. The type of a TiXmlNode can be queried, and it can be cast to its more defined type. */ -class TiXmlNode : public TiXmlBase +class TiXmlNode : public TiXmlBase, private MNonCopyable { friend class TiXmlDocument; friend class TiXmlElement; @@ -686,10 +683,6 @@ protected: TiXmlNode* prev; TiXmlNode* next; - -private: - TiXmlNode(const TiXmlNode&); // not implemented. - void operator=(const TiXmlNode& base); // not allowed. }; /** An attribute is a name-value pair. Elements have an arbitrary @@ -699,7 +692,7 @@ private: part of the tinyXML document object model. There are other suggested ways to look at this problem. */ -class TiXmlAttribute : public TiXmlBase +class TiXmlAttribute : public TiXmlBase, private MNonCopyable { friend class TiXmlAttributeSet; @@ -795,9 +788,6 @@ public: void SetDocument(TiXmlDocument* doc) { document = doc; } private: - TiXmlAttribute(const TiXmlAttribute&); // not implemented. - void operator=(const TiXmlAttribute& base); // not allowed. - TiXmlDocument* document; // A pointer back to a document, for error reporting. TIXML_STRING name; TIXML_STRING value; @@ -818,7 +808,7 @@ private: - I like circular lists - it demonstrates some independence from the (typical) doubly linked list. */ -class TiXmlAttributeSet +class TiXmlAttributeSet : private MNonCopyable { public: TiXmlAttributeSet(); @@ -836,11 +826,6 @@ public: TiXmlAttribute* Find(const TIXML_STRING& name); private: - //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element), - //*ME: this class must be also use a hidden/disabled copy-constructor !!! - TiXmlAttributeSet(const TiXmlAttributeSet&); // not allowed - void operator=(const TiXmlAttributeSet&); // not allowed (as TiXmlAttribute) - TiXmlAttribute sentinel; }; diff --git a/plugins/WinterSpeak/src/AnnounceDialog.h b/plugins/WinterSpeak/src/AnnounceDialog.h index 994e75d524..cc9d5fd94f 100644 --- a/plugins/WinterSpeak/src/AnnounceDialog.h +++ b/plugins/WinterSpeak/src/AnnounceDialog.h @@ -4,8 +4,6 @@ class AnnounceDialog : public MirandaDialog
{
- AnnounceDialog& operator=(const AnnounceDialog&);
-
public:
AnnounceDialog(AnnounceDatabase &db);
~AnnounceDialog();
diff --git a/plugins/WinterSpeak/src/DialogConfigActive.h b/plugins/WinterSpeak/src/DialogConfigActive.h index 28978787f8..77eae56e07 100644 --- a/plugins/WinterSpeak/src/DialogConfigActive.h +++ b/plugins/WinterSpeak/src/DialogConfigActive.h @@ -3,8 +3,6 @@ class DialogConfigActive : public MirandaDialog
{
- DialogConfigActive& operator=(const DialogConfigActive&);
-
public:
//--------------------------------------------------------------------------
// Description : Initialise
diff --git a/plugins/WinterSpeak/src/DialogConfigEngine.h b/plugins/WinterSpeak/src/DialogConfigEngine.h index e103ec1003..5d585bf6cf 100644 --- a/plugins/WinterSpeak/src/DialogConfigEngine.h +++ b/plugins/WinterSpeak/src/DialogConfigEngine.h @@ -7,8 +7,6 @@ class TextToSpeech; class DialogConfigEngine : public MirandaDialog
{
- DialogConfigEngine& operator=(const DialogConfigEngine&);
-
public:
DialogConfigEngine(ConfigDatabase &db);
virtual ~DialogConfigEngine();
diff --git a/plugins/WinterSpeak/src/MirandaDialog.h b/plugins/WinterSpeak/src/MirandaDialog.h index 22424a6f30..5b66634eb4 100644 --- a/plugins/WinterSpeak/src/MirandaDialog.h +++ b/plugins/WinterSpeak/src/MirandaDialog.h @@ -1,5 +1,5 @@ #pragma once
-class MirandaDialog
+class MirandaDialog : private MNonCopyable
{
public:
MirandaDialog(void);
diff --git a/plugins/WinterSpeak/src/Subject.h b/plugins/WinterSpeak/src/Subject.h index f4bba3b075..d3ae97fba6 100644 --- a/plugins/WinterSpeak/src/Subject.h +++ b/plugins/WinterSpeak/src/Subject.h @@ -3,7 +3,7 @@ #include "Observer.h"
#include <list>
-class Subject
+class Subject : private MNonCopyable
{
public:
Subject();
@@ -27,12 +27,6 @@ public: void detach(const Observer &observer);
private:
- //--------------------------------------------------------------------------
- // Description : Disallow assignment operator and copy constructor
- //--------------------------------------------------------------------------
- Subject(const Subject &rhs);
- const Subject & operator=(const Subject &rhs);
-
std::list<Observer *> m_observer_list;
};
|