#include "stdafx.h"
#include <shlwapi.h>
+#include "UnicodeString.h"
#include "Merge.h"
#include "CompareOptions.h"
#include "CompareStats.h"
*/
BOOL CDiffContext::UpdateInfoFromDiskHalf(DIFFITEM & di, BOOL bLeft)
{
- CString filepath
- (
- bLeft == TRUE
- ? paths_ConcatPath(di.getLeftFilepath(GetNormalizedLeft()), di.sLeftFilename)
- : paths_ConcatPath(di.getRightFilepath(GetNormalizedRight()), di.sRightFilename)
- );
+ CString filepath;
+
+ if (bLeft == TRUE)
+ filepath = paths_ConcatPath(di.getLeftFilepath(GetNormalizedLeft()), di.sLeftFilename);
+ else
+ filepath = paths_ConcatPath(di.getRightFilepath(GetNormalizedRight()), di.sRightFilename);
+
DiffFileInfo & dfi = bLeft ? di.left : di.right;
- if (!dfi.Update(filepath))
+ if (!dfi.Update((LPCTSTR)filepath))
return FALSE;
UpdateVersion(di, bLeft);
GuessCodepageEncoding(filepath, &dfi.encoding, m_bGuessEncoding);
*
* @brief Declaration file for DiffFileInfo
*/
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
// $Id$
#ifndef _DIFF_FILE_INFO_H_INCLUDED
DiffFileFlags() : coding(0) { FileFlags(); }
/// Convert flags and coding to string for UI.
- CString toString() const
+ String toString() const
{
- CString sflags;
+ String sflags;
if (attributes & FILE_ATTRIBUTE_READONLY)
sflags += _T("R");
if (attributes & FILE_ATTRIBUTE_HIDDEN)
*
* @date Created: 2003-08-19
*/
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
// $Id$
{
pCtxt->UpdateVersion(di, bLeft);
}
- return dfi.version;
+ return dfi.version.c_str();
}
static CString ColLversionGet(const CDiffContext * pCtxt, const void *p)
{
static CString ColAttrGet(const CDiffContext *, const void *p)
{
const DiffFileFlags &r = *static_cast<const DiffFileFlags *>(p);
- return r.toString();
+ return r.toString().c_str();
}
static CString ColEncodingGet(const CDiffContext *, const void *p)
{
{
const DiffFileFlags &r = *static_cast<const DiffFileFlags *>(p);
const DiffFileFlags &s = *static_cast<const DiffFileFlags *>(q);
- return r.toString().Compare(s.toString());
+ return r.toString().compare(s.toString().c_str());
}
static int ColEncodingSort(const CDiffContext *, const void *p, const void *q)
{
*
* @brief Implementation file for FileFilterHelper class
*/
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
// $Id$
#include "stdafx.h"
CString path = filter.fullpath;
fileInfoStored = &filter.fileinfo;
- fileInfo.Update(path);
+ fileInfo.Update((LPCTSTR)path);
if (fileInfo.mtime != fileInfoStored->mtime ||
fileInfo.size != fileInfoStored->size)
{
*
* @brief Implementation for FileInfo routines
*/
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
// $Id$
#include "stdafx.h"
#include <sys/types.h>
#include <sys/stat.h>
+#include "UnicodeString.h"
#include "FileInfo.h"
/**
* @param [in] sFilePath Full path to file/directory to update
* @return TRUE if information was updated (item was found).
*/
-BOOL FileInfo::Update(const CString &sFilePath)
+BOOL FileInfo::Update(const String &sFilePath)
{
struct _stati64 fstats;
__int64 mtime64 = 0;
flags.reset();
mtime = 0;
- if (_tstati64(sFilePath, &fstats) == 0)
+ if (_tstati64(sFilePath.c_str(), &fstats) == 0)
{
// There can be files without modification date.
// Then we must use creation date. Of course we assume
if ((fstats.st_mode & _S_IFDIR) == 0)
size = fstats.st_size;
- flags.attributes = GetFileAttributes(sFilePath);
+ flags.attributes = GetFileAttributes(sFilePath.c_str());
retVal = TRUE;
}
ctime = 0;
mtime = 0;
size = -1;
- version.Empty();
+ version.clear();
flags.reset();
}
*
* @brief Declaration file for FileInfo
*/
-// RCS ID line follows -- this is updated by CVS
+// ID line follows -- this is updated by SVN
// $Id$
#ifndef _FILE_INFO_H_INCLUDED
#define _FILE_INFO_H_INCLUDED
+#include "UnicodeString.h"
+
/**
* @brief Class for fileflags.
*/
__int64 ctime; /**< time of creation */
__int64 mtime; /**< time of last modify */
__int64 size; /**< file size in bytes, -1 means file does not exist*/
- CString version; /**< string of fixed file version, eg, 1.2.3.4 */
+ String version; /**< string of fixed file version, eg, 1.2.3.4 */
FileFlags flags; /**< file attributes */
FileInfo() { Clear(); }
- BOOL Update(const CString &sFilePath);
+ BOOL Update(const String &sFilePath);
void Clear();
};
GetParentFrame()->SetLastCompareResult(m_diffList.GetSignificantDiffs());
- m_pRescanFileInfo[0]->Update(m_filePaths.GetLeft());
- m_pRescanFileInfo[1]->Update(m_filePaths.GetRight());
+ m_pRescanFileInfo[0]->Update((LPCTSTR)m_filePaths.GetLeft());
+ m_pRescanFileInfo[1]->Update((LPCTSTR)m_filePaths.GetRight());
if (bLeftFileChanged)
{
if (nSaveErrorCode == SAVE_DONE)
{
m_ptBuf[nBuffer]->SetModified(FALSE);
- m_pSaveFileInfo[nBuffer]->Update(strSavePath);
- m_pRescanFileInfo[nBuffer]->Update(m_filePaths.GetPath(nBuffer));
+ m_pSaveFileInfo[nBuffer]->Update((LPCTSTR)strSavePath);
+ m_pRescanFileInfo[nBuffer]->Update((LPCTSTR)m_filePaths.GetPath(nBuffer));
m_filePaths.SetPath(nBuffer, strSavePath);
UpdateHeaderPath(nBuffer);
bSaveSuccess = TRUE;
// Saving succeeded with given/selected filename
if (nSaveErrorCode == SAVE_DONE)
{
- m_pSaveFileInfo[nBuffer]->Update(strSavePath);
- m_pRescanFileInfo[nBuffer]->Update(m_filePaths.GetPath(nBuffer));
+ m_pSaveFileInfo[nBuffer]->Update((LPCTSTR)strSavePath);
+ m_pRescanFileInfo[nBuffer]->Update((LPCTSTR)m_filePaths.GetPath(nBuffer));
m_filePaths.SetPath(nBuffer, strSavePath);
UpdateHeaderPath(nBuffer);
bSaveSuccess = TRUE;
GetMainFrame()->m_strLeftDesc.Empty();
}
- m_pSaveFileInfo[0]->Update(sLeftFile);
- m_pRescanFileInfo[0]->Update(sLeftFile);
+ m_pSaveFileInfo[0]->Update((LPCTSTR)sLeftFile);
+ m_pRescanFileInfo[0]->Update((LPCTSTR)sLeftFile);
// Load left side file
nLeftSuccess = LoadFile(sLeftFile, 0, bROLeft, filelocLeft.encoding.m_codepage);
GetMainFrame()->m_strRightDesc.Empty();
}
- m_pSaveFileInfo[1]->Update(sRightFile);
- m_pRescanFileInfo[1]->Update(sRightFile);
+ m_pSaveFileInfo[1]->Update((LPCTSTR)sRightFile);
+ m_pRescanFileInfo[1]->Update((LPCTSTR)sRightFile);
if (FileLoadResult::IsOk(nLeftSuccess) || FileLoadResult::IsBinary(nLeftSuccess))
{
nRightSuccess = LoadFile(sRightFile, 1, bRORight, filelocRight.encoding.m_codepage);