OSDN Git Service

compiler-calculated maximum value for `m_SourceDefs` (#966)
[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
14 /**
15  * @brief Information for file.
16  * This class expands DirItem class with encoding information and
17  * text stats information.
18  * @sa DirItem.
19  */
20 struct DiffFileInfo : public DirItem
21 {
22 // data
23         FileVersion version; /**< string of fixed file version, eg, 1.2.3.4 */
24         FileTextEncoding encoding; /**< unicode or codepage info */
25         FileTextStats m_textStats; /**< EOL, zero-byte etc counts */
26
27         // We could stash a pointer here to the parent DIFFITEM
28         // but, I ran into trouble with, I think, the DIFFITEM copy constructor
29
30 // methods
31
32         DiffFileInfo() { }
33         //void Clear();
34         void ClearPartial();
35         bool IsEditableEncoding() const;
36 };
37
38 /**
39  * @brief Return true if file is in any Unicode encoding
40  */
41 inline bool DiffFileInfo::IsEditableEncoding() const
42 {
43         return !encoding.m_bom;
44 }