{
public:
SyntaxColors();
- SyntaxColors(const SyntaxColors *pColors);
+ explicit SyntaxColors(const SyntaxColors *pColors);
void Clone(const SyntaxColors *pColors);
COLORREF GetColor(UINT index) const { return m_colors[index]; }
void SetColor(UINT index, COLORREF color);
{
// Construction
public:
- CCCPromptDlg(CWnd* pParent = NULL); // standard constructor
+ explicit CCCPromptDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CCCPromptDlg)
public:
CColorButton();
- CColorButton(COLORREF clrFill);
+ explicit CColorButton(COLORREF clrFill);
void SetColor(COLORREF clrFill, BOOL bInvalidate = TRUE);
COLORREF GetColor() const { return m_clrFill; };
* A constructor taking a language id as parameter.
* @param [in] id Language ID to use.
*/
- LangFileInfo(LANGID id): id(id) { };
+ explicit LangFileInfo(LANGID id): id(id) { };
- LangFileInfo(LPCTSTR path);
+ explicit LangFileInfo(LPCTSTR path);
String GetString(LCTYPE type) const;
private:
AfxMessageBox(_T("Failed to load MergeLang.dll"), MB_ICONSTOP);
return FALSE;
}
- CVersionInfo viInstance = AfxGetInstanceHandle();
+ CVersionInfo viInstance(AfxGetInstanceHandle());
unsigned instanceVerMS = 0;
unsigned instanceVerLS = 0;
viInstance.GetFixedFileVersion(instanceVerMS, instanceVerLS);
- CVersionInfo viResource = m_hCurrentDll;
+ CVersionInfo viResource(m_hCurrentDll);
unsigned resourceVerMS = 0;
unsigned resourceVerLS = 0;
viResource.GetFixedFileVersion(resourceVerMS, resourceVerLS);
while ((h = FindFile(h, pattern.c_str(), &ff)) != INVALID_HANDLE_VALUE)
{
filename = paths_ConcatPath(path, ff.cFileName);
- LangFileInfo lfi = filename.c_str();
+ LangFileInfo lfi(filename.c_str());
if (lfi.id == wLangId)
ff.dwFileAttributes = INVALID_FILE_ATTRIBUTES; // terminate loop
else
size_t capacity; /**< Buffer's size in bytes. */
size_t size; /**< Size of the data in the buffer, <= capacity. */
- buffer(size_t initialSize);
+ explicit buffer(size_t initialSize);
~buffer();
void resize(size_t newSize);
};
String m_strPrivateBuild;
public:
- CVersionInfo(BOOL bVersionOnly);
- CVersionInfo(WORD wLanguage);
+ explicit CVersionInfo(BOOL bVersionOnly);
+ explicit CVersionInfo(WORD wLanguage);
CVersionInfo(LPCTSTR szFileToVersion,
BOOL bDllVersion);
CVersionInfo(LPCTSTR szFileToVersion = NULL,
LPCTSTR szLanguage = NULL,
LPCTSTR szCodepage = NULL);
- CVersionInfo(HINSTANCE hModule);
+ explicit CVersionInfo(HINSTANCE hModule);
String GetFileVersion() const;
String GetCompanyName() const;
String GetFileDescription() const;
class ByteComparator
{
public:
- ByteComparator(const QuickCompareOptions * options);
+ explicit ByteComparator(const QuickCompareOptions * options);
public:
/** @brief Return values for CompareBuffers method. */
{
public:
DiffutilsOptions();
- DiffutilsOptions(const CompareOptions& options);
+ explicit DiffutilsOptions(const CompareOptions& options);
DiffutilsOptions(const DiffutilsOptions& options);
void SetToDiffUtils();
void GetAsDiffOptions(DIFFOPTIONS &options) const;
{
public:
QuickCompareOptions();
- QuickCompareOptions(const CompareOptions& options);
+ explicit QuickCompareOptions(const CompareOptions& options);
bool m_bStopAfterFirstDiff; /**< Optimize compare by stopping after first difference? */
};
DECLARE_DYNAMIC(CompareStatisticsDlg)
public:
- CompareStatisticsDlg(CWnd* pParent = NULL); // standard constructor
+ explicit CompareStatisticsDlg(CWnd* pParent = NULL); // standard constructor
void SetCompareStats(const CompareStats * pStats);
// Dialog Data
RESULT_COUNT //THIS MUST BE THE LAST ITEM
};
- CompareStats(int nDirs);
+ explicit CompareStats(int nDirs);
~CompareStats();
void SetCompareThreadCount(int nCompareThreads)
{
DECLARE_DYNAMIC(ConfirmFolderCopyDlg)
public:
- ConfirmFolderCopyDlg(CWnd* pParent = NULL); // standard constructor
+ explicit ConfirmFolderCopyDlg(CWnd* pParent = NULL); // standard constructor
virtual ~ConfirmFolderCopyDlg();
// Dialog Data
{
if (nDiff < (int) m_diffs.size())
{
- m_diffs[nDiff] = di;
+ m_diffs[nDiff] = DiffRangeInfo(di);
return true;
}
else
size_t prev; /**< link (array index) for doubly-linked chain of non-trivial DIFFRANGEs */
DiffRangeInfo() { InitLinks(); }
- DiffRangeInfo(const DIFFRANGE & di) : DIFFRANGE(di) { InitLinks(); }
+ explicit DiffRangeInfo(const DIFFRANGE & di) : DIFFRANGE(di) { InitLinks(); }
void InitLinks() { next = prev = -1; }
};
{
public:
- DirCmpReport(const std::vector<String>& colRegKeys);
+ explicit DirCmpReport(const std::vector<String>& colRegKeys);
void SetList(IListCtrl *pList);
void SetRootPaths(const PathContext &paths);
void SetColumns(int columns);
DECLARE_DYNAMIC(DirCmpReportDlg)
public:
- DirCmpReportDlg(CWnd* pParent = NULL); // standard constructor
+ explicit DirCmpReportDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_DIRCMP_REPORT };
// Construction
public:
- CDirColsDlg(CWnd* pParent = NULL); // standard constructor
+ explicit CDirColsDlg(CWnd* pParent = NULL); // standard constructor
void AddColumn(const String & name, const String & desc, int log, int phy=-1)
{ column c(name, desc, log, phy); m_cols.push_back(c); }
void AddDefColumn(const String & name, int log, int phy=-1)
DECLARE_DYNAMIC(DirFilterDlg)
public:
- DirFilterDlg(CWnd* pParent = NULL); // standard constructor
+ explicit DirFilterDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_DIR_FILTER };
void CDirView::OnMergeCompareXML()
{
CWaitCursor waitstatus;
- PackingInfo packingInfo = PLUGIN_BUILTIN_XML;
+ PackingInfo packingInfo(PLUGIN_BUILTIN_XML);
OpenSelection(SELECTIONTYPE_NORMAL, &packingInfo);
}
HRESULT STDMETHODCALLTYPE DragLeave(void);\r
HRESULT STDMETHODCALLTYPE Drop(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);\r
\r
- DropHandler(std::function<void(const std::vector<String>&)> callback);\r
+ explicit DropHandler(std::function<void(const std::vector<String>&)> callback);\r
~DropHandler();\r
\r
private:\r
private:
unsigned long nSE;
public:
- SE_Exception(unsigned long n) : nSE(n) {}
+ explicit SE_Exception(unsigned long n) : nSE(n) {}
~SE_Exception() {};
unsigned long getSeNumber() { return nSE; }
* The constructor taking a path as a parameter.
* @param [in] path Full path for the file.
*/
- FileLocation(const String& path) : filepath(path)
+ explicit FileLocation(const String& path) : filepath(path)
{
}
}
bToBeScanned = bMode;
};
- PluginForFile(PLUGIN_MODE bMode)
+ explicit PluginForFile(PLUGIN_MODE bMode)
{
Initialize(bMode);
};
class PackingInfo : public PluginForFile
{
public:
- PackingInfo(PLUGIN_MODE bMode = (PLUGIN_MODE)g_bUnpackerMode)
+ explicit PackingInfo(PLUGIN_MODE bMode = (PLUGIN_MODE)g_bUnpackerMode)
: PluginForFile(bMode)
, subcode(0)
, pufile(0)
class PrediffingInfo : public PluginForFile
{
public:
- PrediffingInfo(PLUGIN_MODE bMode = (PLUGIN_MODE)g_bPredifferMode)
+ explicit PrediffingInfo(PLUGIN_MODE bMode = (PLUGIN_MODE)g_bPredifferMode)
: PluginForFile(bMode)
{
}
class FilterCommentsManager\r
{\r
public:\r
- FilterCommentsManager(const String &IniFileName = _T(""));\r
+ explicit FilterCommentsManager(const String &IniFileName = _T(""));\r
FilterCommentsSet GetSetForFileType(const String& FileTypeName);\r
\r
private:\r
if (cchData == 0 || pchData[cchData - 1] != _T('\0'))
return FALSE;
ReplyMessage(TRUE);
- MergeCmdLineInfo cmdInfo = pchData;
+ MergeCmdLineInfo cmdInfo(pchData);
theApp.ParseArgsAndDoOpen(cmdInfo, this);
return TRUE;
}
CleanupWMtemp();
// Parse command-line arguments.
- MergeCmdLineInfo cmdInfo = GetCommandLine();
+ MergeCmdLineInfo cmdInfo(GetCommandLine());
// If paths were given to commandline we consider this being an invoke from
// commandline (from other application, shellextension etc).
struct Merge7zFormatMergePluginScope
{
- Merge7zFormatMergePluginScope(const PackingInfo *infoUnpacker) : m_oldPackingInfo(*Merge7zFormatMergePluginImpl::GetPackingInfo())
+ explicit Merge7zFormatMergePluginScope(const PackingInfo *infoUnpacker) : m_oldPackingInfo(*Merge7zFormatMergePluginImpl::GetPackingInfo())
{
Merge7zFormatMergePluginImpl::SetPackingInfo(infoUnpacker);
}
struct Merge7zFormatRegister
{
- Merge7zFormatRegister(Merge7z::Format *(*pfnGuessFormat)(const String& path))
+ explicit Merge7zFormatRegister(Merge7z::Format *(*pfnGuessFormat)(const String& path))
{
Add(pfnGuessFormat);
}
class MergeCmdLineInfo
{
public:
- MergeCmdLineInfo(const TCHAR *);
+ explicit MergeCmdLineInfo(const TCHAR *);
public:
void CMergeDoc::OnFileRecompareAsXML()
{
- PackingInfo infoUnpacker = PLUGIN_BUILTIN_XML;
+ PackingInfo infoUnpacker(PLUGIN_BUILTIN_XML);
SetUnpacker(&infoUnpacker);
OnFileReload();
}
{
// Construction
public:
- CPatchDlg(CWnd* pParent = NULL); // standard constructor
+ explicit CPatchDlg(CWnd* pParent = NULL); // standard constructor
// Functions to add and get selected files (as PATCHFILEs)
void AddItem(const PATCHFILES& pf);
typedef PathContextIterator const_iterator;
PathContext();
- PathContext(const String& sLeft);
+ explicit PathContext(const String& sLeft);
PathContext(const String& sLeft, const String& sRight);
PathContext(const String& sLeft, const String& sMiddle, const String& sRight);
PathContext(const PathContext &paths);
- PathContext(const std::vector<String>& paths);
+ explicit PathContext(const std::vector<String>& paths);
String GetAt(int nIndex) const;
String& GetElement(int nIndex);
class PathContextIterator : public std::iterator<std::forward_iterator_tag, String>
{
public:
- PathContextIterator(const PathContext *pPathContext) : m_pPathContext(pPathContext)
+ explicit PathContextIterator(const PathContext *pPathContext) : m_pPathContext(pPathContext)
{
m_sel = (pPathContext->GetSize() == 0) ? -1 : 0;
}
template<class T> struct AutoReleaser
{
- AutoReleaser(T *ptr) : p(ptr) {}
+ explicit AutoReleaser(T *ptr) : p(ptr) {}
~AutoReleaser() { if (p) p->Release(); }
T *p;
};
DECLARE_DYNAMIC(PluginsListDlg)
public:
- PluginsListDlg(CWnd* pParent = NULL); // standard constructor
+ explicit PluginsListDlg(CWnd* pParent = NULL); // standard constructor
virtual ~PluginsListDlg();
// Dialog Data
class ProjectFileHandler: public ContentHandler
{
public:
- ProjectFileHandler(ProjectFile *pProject) : m_pProject(pProject) {}
+ explicit ProjectFileHandler(ProjectFile *pProject) : m_pProject(pProject) {}
void setDocumentLocator(const Locator* loc) {}
void startDocument() {}
class PropArchive : public OptionsPanel
{
public:
- PropArchive(COptionsMgr *optionsMgr);
+ explicit PropArchive(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
class PropBackups : public OptionsPanel
{
public:
- PropBackups(COptionsMgr *optionsMgr);
+ explicit PropBackups(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropCodepage(COptionsMgr *optionsMgr);
+ explicit PropCodepage(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropMergeColors(COptionsMgr *optionsMgr);
+ explicit PropMergeColors(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropCompare(COptionsMgr *optionsMgr);
+ explicit PropCompare(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
class Heksedit
{
public:
- Heksedit(CWnd *pwndParent)
+ explicit Heksedit(CWnd *pwndParent)
{
pv = LoadLibrary(_T("Frhed\\hekseditU.dll"));
if (!pv)
{
// Construction
public:
- PropCompareBinary(COptionsMgr *optionsMgr);
+ explicit PropCompareBinary(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropCompareFolder(COptionsMgr *optionsMgr);
+ explicit PropCompareFolder(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropCompareImage(COptionsMgr *optionsMgr);
+ explicit PropCompareImage(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropEditor(COptionsMgr *optionsMgr);
+ explicit PropEditor(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropGeneral(COptionsMgr *optionsMgr);
+ explicit PropGeneral(COptionsMgr *optionsMgr);
~PropGeneral();
// Implement IOptionsPanel
{
// Construction
public:
- PropRegistry(COptionsMgr *optionsMgr);
+ explicit PropRegistry(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
{
// Construction
public:
- PropShell(COptionsMgr *optionsMgr);
+ explicit PropShell(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
// Construction & Destruction
public:
- PropVss(COptionsMgr *optionsMgr);
+ explicit PropVss(COptionsMgr *optionsMgr);
// Implement IOptionsPanel
virtual void ReadOptions();
SAVECLOSING_DISCARD, /**< Discard changes */
};
- SaveClosingDlg(CWnd* pParent = NULL); // standard constructor
+ explicit SaveClosingDlg(CWnd* pParent = NULL); // standard constructor
void DoAskFor(BOOL bLeft = FALSE, BOOL bMiddle = FALSE, BOOL bRight = FALSE);
// Dialog Data
// Construction
public:
- CSharedFilterDlg(CWnd* pParent); // standard constructor
+ explicit CSharedFilterDlg(CWnd* pParent); // standard constructor
// Implementation
protected:
TRY
{
// BSP - ...to get the specific source safe item to be checked out
- vssi = vssdb.GetVSSItem( strItem.c_str(), 0 );
+ vssi = IVSSItem(vssdb.GetVSSItem( strItem.c_str(), 0 ));
}
CATCH_ALL(e)
{
LARGE_INTEGER freq;
TCHAR funcname[256];
public:
- CWinMergeProfile(LPCTSTR pFuncName) {
+ explicit CWinMergeProfile(LPCTSTR pFuncName) {
lstrcpy(funcname, pFuncName);
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&li[0]);
class TFile : public Poco::File
{
public:
- TFile(const String& path) : File(ucr::toUTF8(path)) {}
+ explicit TFile(const String& path) : File(ucr::toUTF8(path)) {}
void copyTo(const String& path) const { File::copyTo(ucr::toUTF8(path)); }
void moveTo(const String& path) { File::moveTo(ucr::toUTF8(path)); }
void renameTo(const String& path) { File::renameTo(ucr::toUTF8(path)); }
{
// Construction
public:
- CVssPromptDlg(CWnd* pParent = NULL); // standard constructor
+ explicit CVssPromptDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CVssPromptDlg)
{
// Construction
public:
- WMGotoDlg(CWnd* pParent = NULL); // standard constructor
+ explicit WMGotoDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(WMGotoDlg)
{
public:
IVSSItemOld() {} // Calls COleDispatchDriver default constructor
- IVSSItemOld(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSItemOld(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSItemOld(const IVSSItemOld& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSItem() {} // Calls COleDispatchDriver default constructor
- IVSSItem(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSItem(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSItem(const IVSSItem& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSVersions() {} // Calls COleDispatchDriver default constructor
- IVSSVersions(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSVersions(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSVersions(const IVSSVersions& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSVersionOld() {} // Calls COleDispatchDriver default constructor
- IVSSVersionOld(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSVersionOld(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSVersionOld(const IVSSVersionOld& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSVersion() {} // Calls COleDispatchDriver default constructor
- IVSSVersion(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSVersion(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSVersion(const IVSSVersion& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSItems() {} // Calls COleDispatchDriver default constructor
- IVSSItems(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSItems(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSItems(const IVSSItems& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSCheckouts() {} // Calls COleDispatchDriver default constructor
- IVSSCheckouts(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSCheckouts(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSCheckouts(const IVSSCheckouts& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSCheckout() {} // Calls COleDispatchDriver default constructor
- IVSSCheckout(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSCheckout(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSCheckout(const IVSSCheckout& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSDatabaseOld() {} // Calls COleDispatchDriver default constructor
- IVSSDatabaseOld(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSDatabaseOld(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSDatabaseOld(const IVSSDatabaseOld& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSDatabase() {} // Calls COleDispatchDriver default constructor
- IVSSDatabase(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSDatabase(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSDatabase(const IVSSDatabase& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSSUser() {} // Calls COleDispatchDriver default constructor
- IVSSUser(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSSUser(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSSUser(const IVSSUser& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes
{
public:
IVSS() {} // Calls COleDispatchDriver default constructor
- IVSS(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
+ explicit IVSS(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
IVSS(const IVSS& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}
// Attributes