00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014
00021 #if !defined(ZIPARCHIVE_ZIPSTRINGSTRINGSTORESETTINGS_DOT_H)
00022 #define ZIPARCHIVE_ZIPSTRINGSTRINGSTORESETTINGS_DOT_H
00023
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif
00027
00028 #include "stdafx.h"
00029
00030 #ifdef _ZIP_UNICODE_CUSTOM
00031
00032 #include "ZipPlatform.h"
00033 #include "ZipCompatibility.h"
00034
00035
00044 class ZIP_API CZipStringStoreSettings
00045 {
00046 public:
00047
00051 CZipStringStoreSettings()
00052 {
00053 Reset();
00054 }
00055
00062 void SetDefaultNameCodePage(int iPlatform)
00063 {
00064 m_uNameCodePage = ZipCompatibility::GetDefaultNameCodePage(iPlatform);
00065 }
00066
00077 bool IsStandardNameCodePage() const
00078 {
00079 return m_uNameCodePage == ZipCompatibility::GetDefaultNameCodePage();
00080 }
00081
00092 bool IsStandardNameCodePage(int iPlatform) const
00093 {
00094 return m_uNameCodePage == ZipCompatibility::GetDefaultNameCodePage(iPlatform);
00095 }
00096
00106 bool IsStandardCommentCodePage(int iPlatform) const
00107 {
00108 return m_uCommentCodePage == ZipCompatibility::GetDefaultCommentCodePage(iPlatform);
00109 }
00110
00117 bool IsStandardCommentCodePage() const
00118 {
00119 return m_uCommentCodePage == ZipCompatibility::GetDefaultCommentCodePage();
00120 }
00121
00132 bool IsStandard(int iPlatform) const
00133 {
00134 return !m_bStoreNameInExtraData && IsStandardNameCodePage(iPlatform) && IsStandardCommentCodePage(iPlatform);
00135 }
00136
00145 void Reset(int iPlatform)
00146 {
00147 m_bStoreNameInExtraData = false;
00148 SetDefaultNameCodePage(iPlatform);
00149 m_uCommentCodePage = ZipCompatibility::GetDefaultCommentCodePage(iPlatform);
00150 }
00151
00160 void Reset()
00161 {
00162 Reset(ZipPlatform::GetSystemID());
00163 }
00164
00171 void Set(UINT uFileNameCodePage, bool bStoreNameInExtraData, UINT uCommentCodePage)
00172 {
00173 m_uNameCodePage = uFileNameCodePage;
00174 m_bStoreNameInExtraData = bStoreNameInExtraData;
00175 m_uCommentCodePage = uCommentCodePage;
00176 }
00177
00181 bool m_bStoreNameInExtraData;
00182
00186 UINT m_uNameCodePage;
00187
00191 UINT m_uCommentCodePage;
00192 };
00193
00194 #endif
00195
00196 #endif // !defined(ZIPARCHIVE_ZIPSTRINGSTRINGSTORESETTINGS_DOT_H)