8#ifndef RPNX_CORTADO_CLASS_FILE_HPP
9#define RPNX_CORTADO_CLASS_FILE_HPP
42 template <
typename T >
80 template <
typename OutputIt >
84 for (std::byte
const byte : bytes)
101 template <
typename OutputIt >
105 for (std::byte
const byte : bytes)
109 throw std::length_error(
"output range is too small for the JVM class file");
126 template < std::forward_iterator InputIt, std::sentinel_for< InputIt > Sentinel >
129 std::vector< std::byte > bytes;
130 for (InputIt cursor = input; cursor != end; ++cursor)
132 bytes.push_back(
static_cast< std::byte
>(*cursor));
135 value = std::move(result.value);
136 std::advance(input,
static_cast< std::iter_difference_t< InputIt >
>(result.bytes_read));
Typed JVM attributes and the complete owning class-file model.
Exception types used by parsing, validation, and assembly APIs.
JVM class-file, bytecode, validation, generation, and JAR APIs.
processing_mode
Controls whether invalid-but-preservable tool input is accepted.
std::vector< std::byte > serialize_class_file(class_file const &value, class_file_write_options const &options={})
Serializes a class file using the big-endian JVM class-file format.
class_file deserialize_class_file(std::span< std::byte const > bytes, class_file_read_options const &options={})
Deserializes exactly one class file and rejects trailing bytes.
auto serialize_iter(code_body const &value, OutputIt output, bytecode_write_options const &options={}) -> OutputIt
Serial4-style bytecode output-iterator interface.
deserialization_result< class_file > deserialize_class_file_prefix(std::span< std::byte const > bytes, class_file_read_options const &options={})
Deserializes one class file prefix and reports the number of bytes consumed.
auto deserialize_iter(code_body &value, InputIt input, Sentinel end, bytecode_read_options const &options={}) -> InputIt
Serial4-style bytecode forward-iterator interface.
Resource and strictness controls for class-file decoding.
std::size_t maximum_total_attribute_bytes
Aggregate attribute payload budget.
processing_mode mode
Strict validation or loss-preserving tooling behavior.
std::size_t maximum_attribute_length
Largest individual attribute payload accepted.
std::size_t maximum_nesting_depth
Maximum recursive annotation and attribute depth.
std::size_t maximum_structure_nodes
Maximum decoded aggregate nodes.
Strictness controls for class-file encoding.
processing_mode mode
Strict validation or tooling-preserving output behavior.
An owning, typed representation of one JVM class file.
A decoded value and the number of source bytes it consumed.
T value
Fully decoded owning value.
std::size_t bytes_read
Number of input bytes belonging to value.
Bounded, non-throwing validation for structured class-file models.