This commit is contained in:
Igor Pavlov
2015-09-22 00:00:00 +00:00
committed by Kornel Lesiński
parent cba375916f
commit f6444c3256
96 changed files with 7301 additions and 2409 deletions

View File

@@ -10,6 +10,8 @@
namespace NArchive {
namespace NWim {
static const Int32 kNumImagesMaxUpdate = (1 << 10);
class CHandler:
public IInArchive,
public IArchiveGetRawProps,
@@ -34,6 +36,7 @@ class CHandler:
bool _xmlError;
bool _isArc;
bool _unsupported;
bool _set_use_ShowImageNumber;
bool _set_showImageNumber;
@@ -53,6 +56,26 @@ class CHandler:
_defaultImageNumber = -1;
}
bool IsUpdateSupported() const
{
if (ThereIsError()) return false;
if (_db.Images.Size() > kNumImagesMaxUpdate) return false;
// Solid format is complicated. So we disable updating now.
if (!_db.Solids.IsEmpty()) return false;
if (_volumes.Size() == 0)
return true;
if (_volumes.Size() != 2) return false;
if (_volumes[0].Stream) return false;
if (_version != k_Version_NonSolid
// && _version != k_Version_Solid
) return false;
return true;
}
bool ThereIsError() const { return _xmlError || _db.ThereIsError(); }
HRESULT GetSecurity(UInt32 realIndex, const void **data, UInt32 *dataSize, UInt32 *propType);