1#ifndef YAZE_CORE_PATCH_ASM_PATCH_H
2#define YAZE_CORE_PATCH_ASM_PATCH_H
7#include "absl/status/status.h"
133 absl::Status
SaveToPath(
const std::string& output_path);
159 static int ParseValue(
const std::string& value_str);
167 static void UpdateLine(std::string& content,
const std::string& prefix,
168 const std::string& new_value);
177 const std::string& define_name,
int value);
Represents a ZScream-compatible ASM patch file.
absl::Status Save()
Save the patch to its original file location.
AsmPatch(const std::string &file_path, const std::string &folder)
Construct a patch from a file path.
static void UpdateLine(std::string &content, const std::string &prefix, const std::string &new_value)
Update a line in the content that starts with a prefix.
std::vector< PatchParameter > parameters_
const std::string & version() const
const std::vector< PatchParameter > & parameters() const
bool SetParameterValue(const std::string &define_name, int value)
Set the value of a parameter by its define name.
std::vector< PatchParameter > & mutable_parameters()
const std::string & folder() const
PatchParameter * GetParameter(const std::string &define_name)
Get a parameter by its define name.
std::string original_content_
static void UpdateDefineLine(std::string &content, const std::string &define_name, int value)
Update an Asar define line with a new value.
const std::string & author() const
static PatchParameterType ParseType(const std::string &type_str)
Parse a parameter type from a string.
std::string GenerateContent() const
Generate the patch file content with current parameter values.
const std::string & filename() const
const std::string & description() const
const std::string & name() const
void set_enabled(bool enabled)
static int ParseValue(const std::string &value_str)
Parse an integer value from a string (handles $hex and decimal)
bool is_valid() const
Check if the patch was loaded successfully.
const std::string & file_path() const
absl::Status SaveToPath(const std::string &output_path)
Save the patch to a specific path.
void ParseMetadata(const std::string &content)
Parse metadata from the patch file content.
PatchParameterType
Parameter types supported by ZScream-compatible ASM patches.
Represents a configurable parameter within an ASM patch.
std::vector< std::string > choices