yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::core::Z3dkWrapper Class Reference

#include <z3dk_wrapper.h>

Public Member Functions

 Z3dkWrapper ()
 
 ~Z3dkWrapper ()
 
 Z3dkWrapper (const Z3dkWrapper &)=delete
 
Z3dkWrapperoperator= (const Z3dkWrapper &)=delete
 
 Z3dkWrapper (Z3dkWrapper &&) noexcept
 
Z3dkWrapperoperator= (Z3dkWrapper &&) noexcept
 
absl::Status Initialize ()
 
void Shutdown ()
 
bool IsInitialized () const
 
std::string GetVersion () const
 
absl::StatusOr< AsarPatchResultApplyPatch (const std::string &patch_path, std::vector< uint8_t > &rom_data, const std::vector< std::string > &include_paths={})
 
absl::StatusOr< AsarPatchResultApplyPatch (const std::string &patch_path, std::vector< uint8_t > &rom_data, const Z3dkAssembleOptions &options)
 
absl::Status ValidateAssembly (const std::string &asm_path, const std::vector< std::string > &include_paths={})
 
absl::Status ValidateAssembly (const std::string &asm_path, const Z3dkAssembleOptions &options)
 
const std::map< std::string, AsarSymbol > & GetSymbolTable () const
 
std::optional< AsarSymbolFindSymbol (const std::string &name) const
 
std::vector< std::string > GetLastErrors () const
 
std::vector< std::string > GetLastWarnings () const
 
absl::StatusOr< std::vector< AssemblyDiagnostic > > RunLintOnLastResult (const Z3dkAssembleOptions &options) const
 
void Reset ()
 

Private Member Functions

absl::StatusOr< AsarPatchResultAssemble (const std::string &patch_path, std::vector< uint8_t > &rom_data, const Z3dkAssembleOptions &options, bool update_apply_cache)
 
void ClearApplyCache ()
 

Private Attributes

bool initialized_ = false
 
std::map< std::string, AsarSymbolsymbol_table_
 
std::vector< std::string > last_errors_
 
std::vector< std::string > last_warnings_
 
std::unique_ptr<::z3dk::AssembleResultlast_result_
 

Detailed Description

Definition at line 57 of file z3dk_wrapper.h.

Constructor & Destructor Documentation

◆ Z3dkWrapper() [1/3]

yaze::core::Z3dkWrapper::Z3dkWrapper ( )
default

◆ ~Z3dkWrapper()

yaze::core::Z3dkWrapper::~Z3dkWrapper ( )
default

◆ Z3dkWrapper() [2/3]

yaze::core::Z3dkWrapper::Z3dkWrapper ( const Z3dkWrapper & )
delete

◆ Z3dkWrapper() [3/3]

yaze::core::Z3dkWrapper::Z3dkWrapper ( Z3dkWrapper && )
defaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

Z3dkWrapper & yaze::core::Z3dkWrapper::operator= ( const Z3dkWrapper & )
delete

◆ operator=() [2/2]

Z3dkWrapper & yaze::core::Z3dkWrapper::operator= ( Z3dkWrapper && )
defaultnoexcept

◆ Initialize()

absl::Status yaze::core::Z3dkWrapper::Initialize ( )

Definition at line 283 of file z3dk_wrapper.cc.

Referenced by Assemble().

◆ Shutdown()

void yaze::core::Z3dkWrapper::Shutdown ( )
inline

Definition at line 73 of file z3dk_wrapper.h.

References initialized_.

◆ IsInitialized()

bool yaze::core::Z3dkWrapper::IsInitialized ( ) const
inline

Definition at line 74 of file z3dk_wrapper.h.

References initialized_.

◆ GetVersion()

std::string yaze::core::Z3dkWrapper::GetVersion ( ) const

Definition at line 288 of file z3dk_wrapper.cc.

◆ ApplyPatch() [1/2]

absl::StatusOr< AsarPatchResult > yaze::core::Z3dkWrapper::ApplyPatch ( const std::string & patch_path,
std::vector< uint8_t > & rom_data,
const std::vector< std::string > & include_paths = {} )

Definition at line 293 of file z3dk_wrapper.cc.

References ApplyPatch(), and yaze::core::Z3dkAssembleOptions::include_paths.

Referenced by ApplyPatch().

Here is the call graph for this function:

◆ ApplyPatch() [2/2]

absl::StatusOr< AsarPatchResult > yaze::core::Z3dkWrapper::ApplyPatch ( const std::string & patch_path,
std::vector< uint8_t > & rom_data,
const Z3dkAssembleOptions & options )

Definition at line 301 of file z3dk_wrapper.cc.

References Assemble().

Here is the call graph for this function:

◆ ValidateAssembly() [1/2]

absl::Status yaze::core::Z3dkWrapper::ValidateAssembly ( const std::string & asm_path,
const std::vector< std::string > & include_paths = {} )

Definition at line 394 of file z3dk_wrapper.cc.

References yaze::core::Z3dkAssembleOptions::include_paths, and ValidateAssembly().

Referenced by ValidateAssembly().

Here is the call graph for this function:

◆ ValidateAssembly() [2/2]

absl::Status yaze::core::Z3dkWrapper::ValidateAssembly ( const std::string & asm_path,
const Z3dkAssembleOptions & options )

Definition at line 402 of file z3dk_wrapper.cc.

References Assemble().

Here is the call graph for this function:

◆ GetSymbolTable()

const std::map< std::string, AsarSymbol > & yaze::core::Z3dkWrapper::GetSymbolTable ( ) const
inline

Definition at line 96 of file z3dk_wrapper.h.

References symbol_table_.

◆ FindSymbol()

std::optional< AsarSymbol > yaze::core::Z3dkWrapper::FindSymbol ( const std::string & name) const

Definition at line 420 of file z3dk_wrapper.cc.

References symbol_table_.

◆ GetLastErrors()

std::vector< std::string > yaze::core::Z3dkWrapper::GetLastErrors ( ) const
inline

Definition at line 101 of file z3dk_wrapper.h.

References last_errors_.

◆ GetLastWarnings()

std::vector< std::string > yaze::core::Z3dkWrapper::GetLastWarnings ( ) const
inline

Definition at line 102 of file z3dk_wrapper.h.

References last_warnings_.

◆ RunLintOnLastResult()

absl::StatusOr< std::vector< AssemblyDiagnostic > > yaze::core::Z3dkWrapper::RunLintOnLastResult ( const Z3dkAssembleOptions & options) const

Definition at line 429 of file z3dk_wrapper.cc.

References z3dk::LintResult::diagnostics, last_result_, and z3dk::RunLint().

Here is the call graph for this function:

◆ Reset()

void yaze::core::Z3dkWrapper::Reset ( )

Definition at line 449 of file z3dk_wrapper.cc.

References ClearApplyCache(), last_errors_, and last_warnings_.

Here is the call graph for this function:

◆ Assemble()

◆ ClearApplyCache()

void yaze::core::Z3dkWrapper::ClearApplyCache ( )
private

Definition at line 444 of file z3dk_wrapper.cc.

References last_result_, and symbol_table_.

Referenced by Assemble(), and Reset().

Member Data Documentation

◆ initialized_

bool yaze::core::Z3dkWrapper::initialized_ = false
private

Definition at line 121 of file z3dk_wrapper.h.

Referenced by Assemble(), IsInitialized(), and Shutdown().

◆ symbol_table_

std::map<std::string, AsarSymbol> yaze::core::Z3dkWrapper::symbol_table_
private

Definition at line 122 of file z3dk_wrapper.h.

Referenced by Assemble(), ClearApplyCache(), FindSymbol(), and GetSymbolTable().

◆ last_errors_

std::vector<std::string> yaze::core::Z3dkWrapper::last_errors_
private

Definition at line 123 of file z3dk_wrapper.h.

Referenced by Assemble(), GetLastErrors(), and Reset().

◆ last_warnings_

std::vector<std::string> yaze::core::Z3dkWrapper::last_warnings_
private

Definition at line 124 of file z3dk_wrapper.h.

Referenced by Assemble(), GetLastWarnings(), and Reset().

◆ last_result_

std::unique_ptr<::z3dk::AssembleResult> yaze::core::Z3dkWrapper::last_result_
private

Definition at line 129 of file z3dk_wrapper.h.

Referenced by Assemble(), ClearApplyCache(), and RunLintOnLastResult().


The documentation for this class was generated from the following files: