OSDN Git Service

refactor
[winmerge-jp/winmerge-jp.git] / Src / DiffFileInfo.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /** 
3  * @file  DiffFileInfo.h
4  *
5  * @brief Declaration file for DiffFileInfo
6  */
7 #pragma once
8
9 #include "DirItem.h"
10 #include "FileVersion.h"
11 #include "FileTextEncoding.h"
12 #include "FileTextStats.h"
13 #include "PropertySystem.h"
14
15 /**
16  * @brief Information for file.
17  * This class expands DirItem class with encoding information and
18  * text stats information.
19  * @sa DirItem.
20  */
21 struct DiffFileInfo : public DirItem
22 {
23 // data
24         FileVersion version; /**< string of fixed file version, eg, 1.2.3.4 */
25         FileTextEncoding encoding; /**< unicode or codepage info */
26         FileTextStats m_textStats; /**< EOL, zero-byte etc counts */
27         std::unique_ptr<PropertyValues> m_pAdditionalProperties; /**< Additional Property values */
28
29         // We could stash a pointer here to the parent DIFFITEM
30         // but, I ran into trouble with, I think, the DIFFITEM copy constructor
31
32 // methods
33
34         DiffFileInfo() = default;
35         //void Clear();
36         void ClearPartial();
37         bool IsEditableEncoding() const;
38 };
39
40 /**
41  * @brief Return true if file is in any Unicode encoding
42  */
43 inline bool DiffFileInfo::IsEditableEncoding() const
44 {
45         return !encoding.m_bom;
46 }