# Generated by cstruct-stubgen
from typing import BinaryIO, Literal, TypeAlias, overload

import dissect.cstruct as __cs__

class _c_ad1(__cs__.cstruct):
    ADSEGMENTEDFILE_MAGIC: Literal["ADSEGMENTEDFILE\x00"] = ...
    class EntryType(__cs__.Enum):
        File = ...
        Unknown_File = ...
        Deleted = ...
        Directory = ...

    class FileClassType(__cs__.Enum):
        File = ...
        Directory = ...
        ReparsePoint = ...

    class MetaType(__cs__.Enum):
        ItemContentHashes = ...
        FileClass = ...
        FileSize = ...
        PhysicalSize = ...
        Timestamps = ...
        StartCluster = ...
        DateAccessed = ...
        DateCreated = ...
        DateModified = ...
        Encrypted = ...
        Compressed = ...
        ActualFile = ...
        StartSector = ...
        ADSCount = ...
        ShortFilename = ...
        Hidden = ...
        System = ...
        ReadOnly = ...
        Archive = ...
        MFTRecordNumber = ...
        MFTDateChanged = ...
        MFTIsResident = ...
        MFTIsOffline = ...
        MFTIsSparse = ...
        MFTIsTemporary = ...
        MFTOwnerSid = ...
        MFTOwnerName = ...
        MFTGroupSid = ...
        MFTGroupName = ...
        MFTFileDateCreated = ...
        MFTFileDateModified = ...
        MFTFileDateAccessed = ...
        MFTFileDateChanged = ...
        MFTFileSize = ...
        MFTFilePhysicalSize = ...
        IndxFilename = ...
        IndxFileSize = ...
        IndxPhysicalSize = ...
        IndxDateCreated = ...
        IndxDateModified = ...
        IndxDateAccessed = ...
        IndxDateChanged = ...
        AceType = ...
        AceInheritable = ...
        AceSID = ...
        AceName = ...
        AceAccessMask = ...
        AceExecuteFile = ...
        AceReadData = ...
        AceWriteData = ...
        AceAppendData = ...
        AceTraverseFolder = ...
        AceListFolder = ...
        AceCreateFiles = ...
        AceCreateFolders = ...
        AceDeleteChildren = ...
        AceDeleteSelf = ...
        AceReadPermissions = ...
        AceChangePermissions = ...
        AceTakeOwnership = ...
        MD5 = ...
        SHA1 = ...
        ClusterSize = ...
        ClusterCount = ...
        FreeClusterCount = ...
        VolumeSerialNumber = ...
        PosixPermissions = ...

    class SegmentedFileHeader(__cs__.Structure):
        magic: __cs__.CharArray
        unk1: _c_ad1.uint32
        unk2: _c_ad1.uint32
        segment_number: _c_ad1.uint32
        segment_count: _c_ad1.uint32
        segment_size: _c_ad1.uint64
        logical_image_offset: _c_ad1.uint32
        padding: __cs__.CharArray
        @overload
        def __init__(
            self,
            magic: __cs__.CharArray | None = ...,
            unk1: _c_ad1.uint32 | None = ...,
            unk2: _c_ad1.uint32 | None = ...,
            segment_number: _c_ad1.uint32 | None = ...,
            segment_count: _c_ad1.uint32 | None = ...,
            segment_size: _c_ad1.uint64 | None = ...,
            logical_image_offset: _c_ad1.uint32 | None = ...,
            padding: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class LogicalImageHeader(__cs__.Structure):
        magic: __cs__.CharArray
        version: _c_ad1.uint32
        unk1: _c_ad1.uint32
        chunk_size: _c_ad1.uint32
        metadata_offset: _c_ad1.uint64
        first_file_offset: _c_ad1.uint64
        name_len: _c_ad1.uint32
        unk_magic: __cs__.CharArray
        name_offset: _c_ad1.uint64
        attr_guid_offset: _c_ad1.uint64
        unk2: _c_ad1.uint64
        locs_guid_offset: _c_ad1.uint64
        unk3: _c_ad1.uint64
        name: __cs__.CharArray
        @overload
        def __init__(
            self,
            magic: __cs__.CharArray | None = ...,
            version: _c_ad1.uint32 | None = ...,
            unk1: _c_ad1.uint32 | None = ...,
            chunk_size: _c_ad1.uint32 | None = ...,
            metadata_offset: _c_ad1.uint64 | None = ...,
            first_file_offset: _c_ad1.uint64 | None = ...,
            name_len: _c_ad1.uint32 | None = ...,
            unk_magic: __cs__.CharArray | None = ...,
            name_offset: _c_ad1.uint64 | None = ...,
            attr_guid_offset: _c_ad1.uint64 | None = ...,
            unk2: _c_ad1.uint64 | None = ...,
            locs_guid_offset: _c_ad1.uint64 | None = ...,
            unk3: _c_ad1.uint64 | None = ...,
            name: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class FileEntry(__cs__.Structure):
        next: _c_ad1.uint64
        child: _c_ad1.uint64
        meta: _c_ad1.uint64
        zlib_meta: _c_ad1.uint64
        size: _c_ad1.uint64
        type: _c_ad1.EntryType
        name_len: _c_ad1.uint32
        name: __cs__.CharArray
        parent_index: _c_ad1.uint64
        @overload
        def __init__(
            self,
            next: _c_ad1.uint64 | None = ...,
            child: _c_ad1.uint64 | None = ...,
            meta: _c_ad1.uint64 | None = ...,
            zlib_meta: _c_ad1.uint64 | None = ...,
            size: _c_ad1.uint64 | None = ...,
            type: _c_ad1.EntryType | None = ...,
            name_len: _c_ad1.uint32 | None = ...,
            name: __cs__.CharArray | None = ...,
            parent_index: _c_ad1.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class FileEntryChunks(__cs__.Structure):
        num_chunks: _c_ad1.uint64
        chunks: __cs__.Array[_c_ad1.uint64]
        @overload
        def __init__(
            self, num_chunks: _c_ad1.uint64 | None = ..., chunks: __cs__.Array[_c_ad1.uint64] | None = ...
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class FileMeta(__cs__.Structure):
        next: _c_ad1.uint64
        category: _c_ad1.uint32
        type: _c_ad1.MetaType
        len: _c_ad1.uint32
        data: __cs__.CharArray
        @overload
        def __init__(
            self,
            next: _c_ad1.uint64 | None = ...,
            category: _c_ad1.uint32 | None = ...,
            type: _c_ad1.MetaType | None = ...,
            len: _c_ad1.uint32 | None = ...,
            data: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class Footer(__cs__.Structure):
        unk1: __cs__.CharArray
        @overload
        def __init__(self, unk1: __cs__.CharArray | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class ReparsePoint(__cs__.Structure):
        unknown: __cs__.CharArray
        link: __cs__.WcharArray
        @overload
        def __init__(self, unknown: __cs__.CharArray | None = ..., link: __cs__.WcharArray | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

# Technically `c_ad1` is an instance of `_c_ad1`, but then we can't use it in type hints
c_ad1: TypeAlias = _c_ad1
