11#ifndef RPNX_CORTADO_TYPES_HPP
12#define RPNX_CORTADO_TYPES_HPP
16#include <rpnx/macros.hpp>
30 enum class constant_pool_tag : std::uint8_t { utf8 = 1, integer = 3, floating_point = 4, long_integer = 5, double_precision = 6, class_reference = 7,
string = 8, field_reference = 9, method_reference = 10, interface_method_reference = 11, name_and_type = 12, method_handle = 15, method_type = 16, dynamic = 17, invoke_dynamic = 18,
module = 19, package = 20 };
55 enum class method_handle_reference_kind : std::uint8_t { get_field = 1, get_static = 2, put_field = 3, put_static = 4, invoke_virtual = 5, invoke_static = 6, invoke_special = 7, new_invoke_special = 8, invoke_interface = 9 };
58 enum class class_access_flags : std::uint16_t { none = 0, is_public = 0x0001, is_final = 0x0010, invokes_special_super = 0x0020, is_interface = 0x0200, is_abstract = 0x0400, is_synthetic = 0x1000, is_annotation = 0x2000, is_enum = 0x4000, is_module = 0x8000 };
63 return static_cast< class_access_flags >(
static_cast< std::uint16_t
>(left) |
static_cast< std::uint16_t
>(right));
67 enum class field_access_flags : std::uint16_t { none = 0, is_public = 0x0001, is_private = 0x0002, is_protected = 0x0004, is_static = 0x0008, is_final = 0x0010, is_volatile = 0x0040, is_transient = 0x0080, is_synthetic = 0x1000, is_enum = 0x4000 };
72 return static_cast< field_access_flags >(
static_cast< std::uint16_t
>(left) |
static_cast< std::uint16_t
>(right));
76 enum class method_access_flags : std::uint16_t { none = 0, is_public = 0x0001, is_private = 0x0002, is_protected = 0x0004, is_static = 0x0008, is_final = 0x0010, is_synchronized = 0x0020, is_bridge = 0x0040, has_variable_arguments = 0x0080, is_native = 0x0100, is_abstract = 0x0400, is_strict = 0x0800, is_synthetic = 0x1000 };
81 return static_cast< method_access_flags >(
static_cast< std::uint16_t
>(left) |
static_cast< std::uint16_t
>(right));
97 static constexpr std::size_t slot_count = 1;
106 static constexpr std::size_t slot_count = 1;
115 static constexpr std::size_t slot_count = 2;
124 static constexpr std::size_t slot_count = 2;
133 static constexpr std::size_t slot_count = 1;
142 static constexpr std::size_t slot_count = 1;
151 static constexpr std::size_t slot_count = 1;
161 static constexpr std::size_t slot_count = 1;
170 static constexpr constant_pool_tag tag = constant_pool_tag::interface_method_reference;
171 static constexpr std::size_t slot_count = 1;
181 static constexpr std::size_t slot_count = 1;
191 static constexpr std::size_t slot_count = 1;
201 static constexpr std::size_t slot_count = 1;
210 static constexpr std::size_t slot_count = 1;
220 static constexpr std::size_t slot_count = 1;
230 static constexpr std::size_t slot_count = 1;
239 static constexpr std::size_t slot_count = 1;
245 using constant_pool_entry = std::variant< utf8_constant, integer_constant, float_constant, long_constant, double_constant, class_constant, string_constant, fieldref_constant, methodref_constant, interface_methodref_constant, name_and_type_constant, method_handle_constant, method_type_constant, dynamic_constant, invoke_dynamic_constant, module_constant, package_constant >;
294 RPNX_MEMBER_METADATA(
jar_entry,
name,
extra,
comment,
data,
compression,
flags,
modification_time,
modification_date,
internal_attributes,
external_attributes);
JVM class-file, bytecode, validation, generation, and JAR APIs.
compression_method
Compression methods supported by JAR serialization.
constant_pool_tag
A JVM constant-pool tag from JVMS section 4.4.
method_handle_reference_kind
Valid reference-kind discriminators for CONSTANT_MethodHandle.
field_access_flags
JVM field access flags.
std::variant< utf8_constant, integer_constant, float_constant, long_constant, double_constant, class_constant, string_constant, fieldref_constant, methodref_constant, interface_methodref_constant, name_and_type_constant, method_handle_constant, method_type_constant, dynamic_constant, invoke_dynamic_constant, module_constant, package_constant > constant_pool_entry
A typed JVM constant-pool entry.
class_access_flags
JVM class access flags.
method_access_flags
JVM method access flags.
constexpr std::uint32_t class_file_magic
The fixed magic value at the start of every JVM class file.
jar_entry_flags
JAR entry flags preserved by this library.
constexpr class_access_flags operator|(class_access_flags left, class_access_flags right) noexcept
Combines JVM class access flags without discarding their domain type.
A type-safe index into the BootstrapMethods attribute.
std::uint16_t value
Zero-based index into bootstrap_methods_attribute::methods.
constant_pool_index name_index
Index of a utf8_constant containing an internal class or array name.
A JVM class-file version pair.
std::uint16_t minor
Minor class-file version, including 65535 for preview features.
std::uint16_t major
Major class-file version; this release supports values 45 through 70.
A type-safe index into a JVM constant pool.
std::uint16_t value
One-based logical pool slot, or zero where the enclosing structure permits a sentinel.
A CONSTANT_Double entry represented by its exact IEEE 754 bits.
std::uint64_t bits
Exact IEEE 754 binary64 representation, preserving NaN payloads.
A CONSTANT_Dynamic entry.
constant_pool_index name_and_type_index
Index describing the dynamic constant's name and field descriptor.
bootstrap_method_index bootstrap_method_attr_index
Bootstrap method used to compute the constant.
A CONSTANT_Fieldref entry.
constant_pool_index class_index
Index of the declaring class_constant.
constant_pool_index name_and_type_index
Index of the field's name_and_type_constant.
A CONSTANT_Float entry represented by its exact IEEE 754 bits.
std::uint32_t bits
Exact IEEE 754 binary32 representation, preserving NaN payloads.
A CONSTANT_Integer entry represented by its exact IEEE/JVM bits.
std::uint32_t bits
Exact two's-complement bit pattern of the JVM int value.
A CONSTANT_InterfaceMethodref entry.
constant_pool_index class_index
Index of the declaring interface's class_constant.
constant_pool_index name_and_type_index
Index of the interface method's name_and_type_constant.
A CONSTANT_InvokeDynamic entry.
constant_pool_index name_and_type_index
Index describing the call-site name and method descriptor.
bootstrap_method_index bootstrap_method_attr_index
Bootstrap method used to link the call site.
One owning JAR/ZIP entry, with its data stored uncompressed in memory.
zip_dos_time modification_time
Packed last-modification time.
zip_dos_date modification_date
Packed last-modification date.
std::string comment
Exact entry-comment bytes, excluding its wire length.
zip_external_attributes external_attributes
Preserved central-directory external attributes.
std::vector< std::byte > extra
Exact central-directory extra field, excluding its wire length.
jar_entry_flags flags
Preserved supported general-purpose flags.
std::string name
Entry path bytes; use / separators for interoperable JAR names.
std::vector< std::byte > data
Owning uncompressed entry contents.
compression_method compression
Storage method to use when serializing.
zip_internal_attributes internal_attributes
Preserved central-directory internal attributes.
An owning JAR archive representation.
std::vector< jar_entry > entries
Entries in central-directory order; duplicate names remain distinct.
std::string comment
Exact end-of-central-directory archive comment.
Explicit resource limits applied while reading an untrusted JAR archive.
std::size_t maximum_total_uncompressed_size
Maximum inflated bytes accepted across the archive.
std::size_t maximum_entry_uncompressed_size
Maximum inflated bytes accepted for one entry.
A CONSTANT_Long entry represented by its exact two's-complement bits.
std::uint64_t bits
Exact two's-complement bit pattern of the JVM long value.
A CONSTANT_MethodHandle entry.
constant_pool_index reference_index
Index of the compatible field or method reference constant.
method_handle_reference_kind reference_kind
Operation performed by the handle.
A CONSTANT_MethodType entry.
constant_pool_index descriptor_index
Index of a utf8_constant containing a method descriptor.
A CONSTANT_Methodref entry.
constant_pool_index name_and_type_index
Index of the method's name_and_type_constant.
constant_pool_index class_index
Index of the declaring class or interface constant.
constant_pool_index name_index
Index of the module-name utf8_constant.
A CONSTANT_NameAndType entry.
constant_pool_index descriptor_index
Index of the field or method descriptor utf8_constant.
constant_pool_index name_index
Index of the member-name utf8_constant.
A CONSTANT_Package entry.
constant_pool_index name_index
Index of the package-name utf8_constant.
constant_pool_index string_index
Index of the utf8_constant containing the string contents.
static constexpr constant_pool_tag tag
Wire tag for this entry type.
std::string bytes
Exact modified UTF-8 bytes, without the wire length prefix.
static constexpr std::size_t slot_count
Number of logical constant-pool slots occupied.
A packed MS-DOS date value from a ZIP entry header.
std::uint16_t encoded_value
Packed ZIP year-since-1980, month, and day fields.
A packed MS-DOS time value from a ZIP entry header.
std::uint16_t encoded_value
Packed ZIP hour, minute, and two-second-resolution second fields.
Host-defined external attributes from a ZIP central-directory entry.
std::uint32_t encoded_value
Exact central-directory host-defined external-attributes field.
Host-defined internal attributes from a ZIP central-directory entry.
std::uint16_t encoded_value
Exact central-directory internal-attributes field.