Lhaz
lhazfile.h
[詳解]
1 /*************************************************************************/
6 #pragma once
7 
8 #include "altstr.hpp"
9 #include <vector>
10 #include <time.h>
11 
12 class LHAZFILETREE;
13 
14 class LHAZFILE {
15 public:
17  //
18  struct PARENT {
19  WSTR m_dir;
20  WSTR m_id;
21  bool m_isroot;
22  WSTR m_uri;
23  };
24  //
25  LHAZFILE(void);
26  LHAZFILE(const WSTR& name, const time_t& t, int icon, bool isdir, LONGLONG size);
27  virtual ‾LHAZFILE(void);
28  //
29  virtual fpos_t GetFpos(void) const;
30  virtual bool IsVirtual(void) const;
31  virtual void SetVirtual(bool b);
32  virtual const WSTR& GetAlternateUri(void) const;
33  virtual const WSTR& GetEditUri(void) const;
34  virtual bool IsNewDir(void) const;
35  //
36  const WSTR& GetName(void) const { return m_name; }
37  void SetName(const WSTR& name) { m_name = name; }
38  const WSTR& GetFileName(void) const { return m_filename; }
39  void SetFileName(const WSTR& name, bool dir = false);
40  time_t GetLastModified(void) const { return m_lastmodified; }
41  const WSTR& GetLastModifiedText(void) const { return m_lastmodified_txt; }
42  void SetLastModified(const time_t& t);
43  void SetLastModifiedText(void);
44  LONGLONG GetSize(void) const { return m_size; }
45  const WSTR& GetSizeText(void) const { return m_size_txt; }
46  const WSTR& GetSizeTextKB(void) const { return m_size_txt_kb; }
47  void SetSize(LONGLONG size);
48  void SetSizeText(bool dispzero);
49  const WSTR& GetType(void) const { return m_type; }
50  void SetType(const WSTR& type) { m_type = type; }
51  LONGLONG GetPackedSize(void) const { return m_packedsize; }
52  void SetPackedSize(LONGLONG size);
53  const WSTR& GetPackedSizeText(void) const { return m_packedsize_txt; }
54  const WSTR& GetPackedSizeTextKB(void) const { return m_packedsize_txt_kb; }
55  void SetPackedSizeText(void);
56  float GetRatio(void) const { return m_ratio; }
57  const WSTR& GetRatioText(void) const { return m_ratio_txt; }
58  void SetRatio(void);
59  int GetMethod(void) const { return m_method_num; }
60  void SetMethod(int m) { m_method_num = m; }
61  const WSTR& GetMethodText(void) const { return m_method_txt; }
62  void SetMethodText(const WSTR& m) { m_method_txt = m; }
63  const WSTR& GetDir(void) const { return m_dirname; }
64  void SetDir(const WSTR& d);
65  int GetIcon(void) const { return m_icon; }
66  void SetIcon(int i) { m_icon = i; }
67  bool IsDir(void) const { return m_isdir; }
68  void SetIsDir(bool b) { m_isdir = b; }
69  const WSTR& GetDsp(FIELD field, bool treeview, int viewkb) const;
70  bool Match(const TCHAR* p, TCHAR* s, int f) const;
71  WSTR GetColContent(FIELD c);
72  const std::vector<PARENT>& GetParents(void) const { return m_parents; }
73  const WSTR& GetParentDir(void) const;
74  const WSTR& GetParentUri(void) const;
75  LHAZFILETREE* GetTree(void) const { return m_tree; }
76  void SetTree(LHAZFILETREE* t) { m_tree = t; }
77 
78 protected:
79  WSTR m_dirname;
80  WSTR m_filename;
81  int m_icon;
82  bool m_isdir;
87  WSTR m_name;
88  LONGLONG m_packedsize;
91  std::vector<PARENT> m_parents;
92  float m_ratio;
94  LONGLONG m_size;
95  WSTR m_size_txt;
98  WSTR m_type;
99 
100 };
Definition: lhazfile.h:14
WSTR m_filename
Definition: lhazfile.h:80
Definition: lhazfile.h:16
LHAZFILETREE * GetTree(void) const
Definition: lhazfile.h:75
virtual bool IsNewDir(void) const
Definition: lhazfile.cpp:320
void SetSize(LONGLONG size)
Definition: lhazfile.cpp:68
const WSTR & GetFileName(void) const
Definition: lhazfile.h:38
const WSTR & GetSizeTextKB(void) const
Definition: lhazfile.h:46
void SetName(const WSTR &name)
Definition: lhazfile.h:37
void SetFileName(const WSTR &name, bool dir=false)
Definition: lhazfile.cpp:115
const WSTR & GetName(void) const
Definition: lhazfile.h:36
void SetIsDir(bool b)
Definition: lhazfile.h:68
Definition: lhazfile.h:16
WSTR m_lastmodified_txt
Definition: lhazfile.h:84
WSTR m_method_txt
Definition: lhazfile.h:86
WSTR m_uri
Definition: lhazfile.h:22
const WSTR & GetPackedSizeTextKB(void) const
Definition: lhazfile.h:54
Definition: lhazfiletree.h:27
Definition: lhazfile.h:16
const WSTR & GetMethodText(void) const
Definition: lhazfile.h:61
const WSTR & GetDir(void) const
Definition: lhazfile.h:63
std::vector< PARENT > m_parents
Definition: lhazfile.h:91
LONGLONG m_packedsize
Definition: lhazfile.h:88
bool IsDir(void) const
Definition: lhazfile.h:67
const WSTR & GetParentDir(void) const
Definition: lhazfile.cpp:289
const WSTR & GetParentUri(void) const
Definition: lhazfile.cpp:300
LONGLONG GetSize(void) const
Definition: lhazfile.h:44
float GetRatio(void) const
Definition: lhazfile.h:56
void SetRatio(void)
Definition: lhazfile.cpp:136
WSTR m_packedsize_txt_kb
Definition: lhazfile.h:90
Definition: lhazfile.h:16
void SetMethod(int m)
Definition: lhazfile.h:60
WSTR GetColContent(FIELD c)
Definition: lhazfile.cpp:232
float m_ratio
Definition: lhazfile.h:92
virtual const WSTR & GetAlternateUri(void) const
Definition: lhazfile.cpp:280
Definition: lhazfile.h:16
LHAZFILE(void)
Definition: lhazfile.cpp:12
FIELD
Definition: lhazfile.h:16
WSTR m_type
Definition: lhazfile.h:98
WSTR m_ratio_txt
Definition: lhazfile.h:93
WSTR m_size_txt
Definition: lhazfile.h:95
Definition: lhazfile.h:18
void SetType(const WSTR &type)
Definition: lhazfile.h:50
LONGLONG m_size
Definition: lhazfile.h:94
void SetLastModifiedText(void)
Definition: lhazfile.cpp:51
const WSTR & GetDsp(FIELD field, bool treeview, int viewkb) const
Definition: lhazfile.cpp:167
Definition: lhazfile.h:16
const WSTR & GetType(void) const
Definition: lhazfile.h:49
virtual void SetVirtual(bool b)
Definition: lhazfile.cpp:273
void SetPackedSize(LONGLONG size)
Definition: lhazfile.cpp:97
const WSTR & GetLastModifiedText(void) const
Definition: lhazfile.h:41
WSTR m_name
Definition: lhazfile.h:87
void SetIcon(int i)
Definition: lhazfile.h:66
const std::vector< PARENT > & GetParents(void) const
Definition: lhazfile.h:72
void SetSizeText(bool dispzero)
Definition: lhazfile.cpp:77
void SetMethodText(const WSTR &m)
Definition: lhazfile.h:62
WSTR m_size_txt_kb
Definition: lhazfile.h:96
time_t m_lastmodified
Definition: lhazfile.h:83
virtual const WSTR & GetEditUri(void) const
Definition: lhazfile.cpp:311
const WSTR & GetRatioText(void) const
Definition: lhazfile.h:57
Definition: lhazfile.h:16
Definition: lhazfile.h:16
virtual bool IsVirtual(void) const
Definition: lhazfile.cpp:224
bool m_isroot
Definition: lhazfile.h:21
int m_method_num
Definition: lhazfile.h:85
WSTR m_dirname
Definition: lhazfile.h:79
Definition: lhazfile.h:16
virtual fpos_t GetFpos(void) const
Definition: lhazfile.cpp:216
LHAZFILETREE * m_tree
Definition: lhazfile.h:97
const WSTR & GetPackedSizeText(void) const
Definition: lhazfile.h:53
void SetPackedSizeText(void)
Definition: lhazfile.cpp:106
time_t GetLastModified(void) const
Definition: lhazfile.h:40
void SetTree(LHAZFILETREE *t)
Definition: lhazfile.h:76
bool m_isdir
Definition: lhazfile.h:82
WSTR m_packedsize_txt
Definition: lhazfile.h:89
virtual ‾LHAZFILE(void)
Definition: lhazfile.cpp:35
int GetMethod(void) const
Definition: lhazfile.h:59
Definition: lhazfile.h:16
WSTR m_dir
Definition: lhazfile.h:19
int GetIcon(void) const
Definition: lhazfile.h:65
void SetLastModified(const time_t &t)
Definition: lhazfile.cpp:42
bool Match(const TCHAR *p, TCHAR *s, int f) const
Definition: lhazfile.cpp:190
LONGLONG GetPackedSize(void) const
Definition: lhazfile.h:51
WSTR m_id
Definition: lhazfile.h:20
int m_icon
Definition: lhazfile.h:81
void SetDir(const WSTR &d)
Definition: lhazfile.cpp:155
const WSTR & GetSizeText(void) const
Definition: lhazfile.h:45