1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//! `File` metadata table implementation.
//!
//! This module provides structures and utilities for working with the `File` metadata table,
//! which lists files in a multi-file assembly. Each entry contains metadata about files
//! that are part of the assembly but stored separately from the main manifest.
//!
//! # Overview
//! The `File` table enables multi-file assembly scenarios:
//! - **Multi-module assemblies**: Additional .netmodule files containing code
//! - **Resource files**: Binary data files (.resources, images, data)
//! - **Native libraries**: Unmanaged DLLs for P/Invoke operations
//! - **Documentation**: Associated help files and XML documentation
//! - **Satellite assemblies**: Localization and culture-specific resources
//!
//! # Components
//! - [`FileRaw`]: Raw file data read directly from metadata tables
//! - [`File`]: Owned file data with resolved references and complete metadata
//! - [`FileLoader`]: Processes and loads file metadata
//! - [`FileMap`]: Thread-safe collection of files indexed by token
//! - [`FileList`]: Vector-based collection of files
//! - [`FileRc`]: Reference-counted file for shared ownership
//!
//! # Table Structure
//! Each `File` entry contains:
//! - **Flags**: File attributes indicating type and characteristics
//! - **Name**: String reference to the file name
//! - **`HashValue`**: Cryptographic hash for integrity verification
//!
//! # File Types
//! Files can be categorized by their purpose:
//! ```text
//! ┌─────────────────┬──────────────────────────────────────┐
//! │ Type │ Description │
//! ├─────────────────┼──────────────────────────────────────┤
//! │ Module │ .netmodule with executable code │
//! │ Resource │ .resources with binary data │
//! │ Native Library │ .dll with unmanaged code │
//! │ Documentation │ .xml with API documentation │
//! │ Data File │ Configuration or content files │
//! └─────────────────┴──────────────────────────────────────┘
//! ```
//!
//!
//! # File Attributes
//! The [`FileAttributes`] module defines flags for file classification:
//! - **`CONTAINS_META_DATA`**: File contains .NET metadata (executable modules)
//! - **`CONTAINS_NO_META_DATA`**: Resource files without metadata
//!
//! # Hash Verification
//! Each file includes a cryptographic hash for security:
//! - **SHA-1 or SHA-256**: Algorithm depends on assembly version
//! - **Integrity checking**: Verifies file hasn't been tampered with
//! - **Loading validation**: Runtime can verify file authenticity
//! - **Security assurance**: Prevents malicious file substitution
//!
//! # Import Integration
//! Files can participate in import resolution through [`crate::metadata::imports::UnifiedImportContainer`]:
//! - Module files can export types and members
//! - Import analysis traverses file dependencies
//! - Cross-file reference resolution
//!
//! # ECMA-335 Reference
//! See ECMA-335, Partition II, §22.19 for the complete File table specification.
use crate;
use SkipMap;
use Arc;
pub use *;
pub use *;
pub use *;
pub use *;
/// Thread-safe map of file entries indexed by file token.
///
/// This skip list-based map provides efficient concurrent access to file metadata,
/// allowing multiple threads to resolve file information during assembly loading
/// and multi-file analysis.
pub type FileMap = ;
/// Thread-safe vector of file entries.
///
/// This collection provides ordered access to file entries, useful for sequential
/// processing and bulk operations during assembly analysis and file enumeration.
pub type FileList = ;
/// Reference-counted file entry.
///
/// Provides shared ownership of [`File`] instances, enabling efficient sharing
/// of file metadata across multiple data structures and threads.
pub type FileRc = ;
/// File attribute flags for the `FileAttributes` field.
///
/// These constants define the possible values for the `Flags` field in File table entries,
/// indicating the type and characteristics of files in multi-file assemblies.
///
/// # Usage
/// ```rust,ignore
/// use dotscope::metadata::tables::file::FileAttributes;
///
/// // Check if a file contains metadata
/// // if file.flags & FileAttributes::CONTAINS_META_DATA != 0 {
/// // println!("File contains .NET metadata");
/// // }
/// ```
///
/// # ECMA-335 Reference
/// See ECMA-335, Partition II, §22.19 for File table flag specifications.
/// Import container implementation for File entries.
///
/// This implementation allows files to participate in import resolution by providing
/// access to imports defined within or referenced by the file. This is particularly
/// useful for multi-module assemblies where imports span multiple files.