#include "paths.h"
/**
+ * @brief Copy constructor.
+ */
+PathInfo::PathInfo(const PathInfo &pi)
+{
+ m_sPath = pi.m_sPath;
+}
+
+/**
+ * @brief Get path.
+ * @param [in] sbNormalized TRUE if path is wanted in normalized format.
+ */
+CString PathInfo::GetPath(BOOL bNormalized /*= TRUE*/) const
+{
+ if (!bNormalized)
+ {
+ if (paths_EndsWithSlash(m_sPath))
+ return m_sPath + _T("\\");
+ else
+ return m_sPath;
+ }
+ else
+ return m_sPath;
+}
+
+/**
* @brief Set path.
* @param [in] sPath New path for item.
*/
void PathInfo::SetPath(CString sPath)
{
m_sPath = sPath;
- m_sNormalizedPath = sPath;
}
/**
*/
void PathInfo::NormalizePath()
{
- m_sNormalizedPath = m_sPath;
- paths_normalize(m_sNormalizedPath);
+ paths_normalize(m_sPath);
}
PathContext::PathContext()
* @brief Return left path.
* @param [in] sNormalized If TRUE normalized path is returned.
*/
-const CString& PathContext::GetLeft(BOOL bNormalized) const
+CString PathContext::GetLeft(BOOL bNormalized) const
{
return m_pathLeft.GetPath(bNormalized);
}
* @brief Return right path.
* @param [in] sNormalized If TRUE normalized path is returned.
*/
-const CString& PathContext::GetRight(BOOL bNormalized) const
+CString PathContext::GetRight(BOOL bNormalized) const
{
return m_pathRight.GetPath(bNormalized);
}
/**
* @brief Information for one path.
+ *
+ * Path is stored in normalized format (no trailing slash).
*/
class PathInfo
{
public:
PathInfo() {}
+ PathInfo(const PathInfo &pi);
- const CString & GetPath(BOOL bNormalized = TRUE) const
- { return (bNormalized ? m_sNormalizedPath : m_sPath); }
+ CString GetPath(BOOL bNormalized = TRUE) const;
void SetPath(CString path);
void NormalizePath();
private:
CString m_sPath; /**< Directory / file path */
- CString m_sNormalizedPath; /**< Normalized version of m_sPath (preferred)*/
};
/**
public:
PathContext();
PathContext(CString sLeft, CString sRight);
- const CString & GetLeft(BOOL bNormalized = TRUE) const;
- const CString & GetRight(BOOL bNormalized = TRUE) const;
+ CString GetLeft(BOOL bNormalized = TRUE) const;
+ CString GetRight(BOOL bNormalized = TRUE) const;
void SetLeft(LPCTSTR path);
void SetRight(LPCTSTR path);
2005-06-12 Kimmo
BUG: [ 1218133 ] German options dialog is to wide
Src/Languages/German: MergeGerman.rc
+ PATCH: [ 1213634 ] Don't store two path copies in PathContext
+ Src: PathContext.cpp PathContext.h
2005-06-11 Tim
BUG: [ 1218096 ] Options: 'Line Diff Coloring' frame don't fit