ZipStringStoreSettings.h
Go to the documentation of this file.
1 
2 // This source file is part of the ZipArchive Library Open Source distribution
3 // and is Copyrighted 2000 - 2022 by Artpol Software - Tadeusz Dracz
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // For the licensing details refer to the License.txt file.
11 //
12 // Web Site: https://www.artpol-software.com
14 
21 #if !defined(ZIPARCHIVE_ZIPSTRINGSTRINGSTORESETTINGS_DOT_H)
22 #define ZIPARCHIVE_ZIPSTRINGSTRINGSTORESETTINGS_DOT_H
23 
24 #if _MSC_VER > 1000
25 #pragma once
26 #endif
27 
28 #include "stdafx.h"
29 
30 #ifdef _ZIP_UNICODE_CUSTOM
31 
32 #include "ZipPlatform.h"
33 #include "ZipCompatibility.h"
34 
35 
45 {
46 public:
47 
51 #pragma warning(suppress: 26495)
53  {
54  Reset();
55  }
56 
63  void SetDefaultNameCodePage(int iPlatform)
64  {
65  m_uNameCodePage = ZipCompatibility::GetDefaultNameCodePage(iPlatform);
66  }
67 
78  bool IsStandardNameCodePage() const
79  {
80  return m_uNameCodePage == ZipCompatibility::GetDefaultNameCodePage();
81  }
82 
93  bool IsStandardNameCodePage(int iPlatform) const
94  {
95  return m_uNameCodePage == ZipCompatibility::GetDefaultNameCodePage(iPlatform);
96  }
97 
107  bool IsStandardCommentCodePage(int iPlatform) const
108  {
109  return m_uCommentCodePage == ZipCompatibility::GetDefaultCommentCodePage(iPlatform);
110  }
111 
118  bool IsStandardCommentCodePage() const
119  {
120  return m_uCommentCodePage == ZipCompatibility::GetDefaultCommentCodePage();
121  }
122 
133  bool IsStandard(int iPlatform) const
134  {
135  return !m_bStoreNameInExtraData && IsStandardNameCodePage(iPlatform) && IsStandardCommentCodePage(iPlatform);
136  }
137 
146  void Reset(int iPlatform)
147  {
148  m_bStoreNameInExtraData = false;
149  SetDefaultNameCodePage(iPlatform);
150  m_uCommentCodePage = ZipCompatibility::GetDefaultCommentCodePage(iPlatform);
151  }
152 
161  void Reset()
162  {
163  Reset(ZipPlatform::GetSystemID());
164  }
165 
172  void Set(UINT uFileNameCodePage, bool bStoreNameInExtraData, UINT uCommentCodePage)
173  {
174  m_uNameCodePage = uFileNameCodePage;
175  m_bStoreNameInExtraData = bStoreNameInExtraData;
176  m_uCommentCodePage = uCommentCodePage;
177  }
178 
183 
188 
193 };
194 
195 #endif
196 
197 #endif // !defined(ZIPARCHIVE_ZIPSTRINGSTRINGSTORESETTINGS_DOT_H)

The ZipArchive Library Copyright © 2000 - 2022 Artpol Software - Tadeusz Dracz. Generated at Sat Dec 17 2022 19:57:04.