⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arjitem.h

📁 压缩软件源码
💻 H
字号:
// Archive/ArjItem.h

#ifndef __ARCHIVE_ARJ_ITEM_H
#define __ARCHIVE_ARJ_ITEM_H

#include "Common/Types.h"
#include "Common/String.h"
#include "ArjHeader.h"

namespace NArchive {
namespace NArj {

struct CVersion
{
  Byte Version;
  Byte HostOS;
};

inline bool operator==(const CVersion &v1, const CVersion &v2)
  { return (v1.Version == v2.Version) && (v1.HostOS == v2.HostOS); }
inline bool operator!=(const CVersion &v1, const CVersion &v2)
  {  return !(v1 == v2); } 

class CItem
{
public:
  Byte Version;
  Byte ExtractVersion;
  Byte HostOS;
  Byte Flags;
  Byte Method;
  Byte FileType;
  UInt32 ModifiedTime;
  UInt32 PackSize;
  UInt32 Size;
  UInt32 FileCRC;

  // UInt16 FilespecPositionInFilename;
  UInt16 FileAccessMode;
  // Byte FirstChapter;
  // Byte LastChapter;
  
  AString Name;
  
  bool IsEncrypted() const { return (Flags & NFileHeader::NFlags::kGarbled) != 0; }
  bool IsDirectory() const { return (FileType == NFileHeader::NFileType::kDirectory); }
  UInt32 GetWinAttributes() const 
  {
    UInt32 winAtrributes;
    switch(HostOS)
    {
      case NFileHeader::NHostOS::kMSDOS:
      case NFileHeader::NHostOS::kWIN95:
        winAtrributes = FileAccessMode;
        break;
      default:
        winAtrributes = 0;
    }
    if (IsDirectory())
      winAtrributes |= FILE_ATTRIBUTE_DIRECTORY;
    return winAtrributes;
  }
};

class CItemEx: public CItem
{
public:
  UInt64 DataPosition;
};

}}

#endif


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -