dex++ 0.3.1
C++ and C API reference
Loading...
Searching...
No Matches
io.hpp File Reference
#include <cstddef>
#include <cstdint>
#include <expected>
#include <functional>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include "common/error.hpp"
#include "model/types.hpp"

Classes

struct  dex::model::ReadOptions
 
struct  dex::model::WriteOptions
 
struct  dex::model::PoolStats
 How many entries each pool of the written file would have. More...
 

Namespaces

namespace  dex
 
namespace  dex::model
 An editable, in-memory model of one DEX file.
 

Functions

std::expected< Dex, Error > dex::model::read (std::span< const uint8_t > bytes, const ReadOptions &options={})
 Read a whole DEX file into a model.
 
std::expected< Dex, Error > dex::model::read_file (const std::string &path, const ReadOptions &options={})
 
std::expected< std::vector< uint8_t >, Error > dex::model::write (const Dex &dex, const WriteOptions &options={})
 Write a model as a DEX file.
 
std::expected< void, Error > dex::model::write_file (const Dex &dex, const std::string &path, const WriteOptions &options={})
 
std::vector< Problem > dex::model::validate (const Dex &dex)
 Every rule of the format the model breaks.
 
uint32_t dex::model::required_version (const Dex &dex)
 The lowest DEX version that has every feature dex uses: 37 for default and private interface methods, 38 for invoke-polymorphic, invoke-custom and method handle / method type values, 39 for const-method-handle and const-method-type.
 
PoolStats dex::model::pool_stats (const Dex &dex)
 
void dex::model::rename_types (Dex &dex, const std::function< std::optional< std::string >(std::string_view)> &rename)
 Rename classes everywhere they are referenced.