Namespaces | |
namespace | anonymous_namespace{bps.cc} |
namespace | anonymous_namespace{hex.cc} |
Classes | |
class | FileDialogWrapper |
class | Flag |
class | FlagParser |
class | FlagRegistry |
struct | HexStringParams |
class | IFlag |
class | LogManager |
A singleton that manages all logging configuration and output. More... | |
class | NotifyValue |
A class to manage a value that can be modified and notify when it changes. More... | |
class | PlatformPaths |
Cross-platform utilities for file system paths. More... | |
struct | SDL_Deleter |
Deleter for SDL_Window and SDL_Renderer. More... | |
struct | SDL_Surface_Deleter |
struct | SDL_Texture_Deleter |
Enumerations | |
enum class | Platform { kUnknown , kMacOS , kiOS , kWindows , kLinux } |
enum class | LogLevel { YAZE_DEBUG , INFO , WARNING , ERROR , FATAL } |
Defines the severity levels for log messages. This allows for filtering messages based on their importance. More... | |
Functions | |
absl::Status | ApplyBpsPatch (const std::vector< uint8_t > &source, const std::vector< uint8_t > &patch, std::vector< uint8_t > &output) |
absl::Status | CreateBpsPatch (const std::vector< uint8_t > &source, const std::vector< uint8_t > &target, std::vector< uint8_t > &patch) |
std::string | GetFileExtension (const std::string &filename) |
Gets the file extension from a filename. | |
std::string | GetFileName (const std::string &filename) |
Gets the filename from a full path. | |
std::string | LoadFile (const std::string &filename) |
Loads the entire contents of a file into a string. | |
std::string | LoadFileFromConfigDir (const std::string &filename) |
Loads a file from the user's config directory. | |
void | SaveFile (const std::string &filename, const std::string &contents) |
std::string | GetResourcePath (const std::string &resource_path) |
std::string | GetBundleResourcePath () |
GetBundleResourcePath returns the path to the bundle resource directory. Specific to MacOS. | |
FlagRegistry * | global_flag_registry () |
std::string | HexByte (uint8_t byte, HexStringParams params) |
std::string | HexWord (uint16_t word, HexStringParams params) |
std::string | HexLong (uint32_t dword, HexStringParams params) |
std::string | HexLongLong (uint64_t qword, HexStringParams params) |
template<typename... Args> | |
void | logf (const absl::FormatSpec< Args... > &format, Args &&... args) |
void | logf (absl::string_view message) |
|
strong |
Enumerator | |
---|---|
kUnknown | |
kMacOS | |
kiOS | |
kWindows | |
kLinux |
Definition at line 52 of file file_util.h.
|
strong |
absl::Status yaze::util::ApplyBpsPatch | ( | const std::vector< uint8_t > & | source, |
const std::vector< uint8_t > & | patch, | ||
std::vector< uint8_t > & | output | ||
) |
Definition at line 79 of file bps.cc.
Referenced by yaze::cli::anonymous_namespace{tui.cc}::ApplyBpsPatchComponent(), and yaze::cli::handlers::ProjectBuildCommandHandler::Execute().
absl::Status yaze::util::CreateBpsPatch | ( | const std::vector< uint8_t > & | source, |
const std::vector< uint8_t > & | target, | ||
std::vector< uint8_t > & | patch | ||
) |
std::string yaze::util::GetFileExtension | ( | const std::string & | filename | ) |
Gets the file extension from a filename.
Uses std::filesystem for cross-platform consistency.
filename | The name of the file. |
Definition at line 15 of file file_util.cc.
Referenced by yaze::editor::AgentChatWidget::CreateNewFileInEditor(), yaze::editor::EditorManager::DrawMenuBar(), yaze::editor::AgentChatWidget::OpenFileInEditor(), and yaze::emu::ui::RenderNavBar().
std::string yaze::util::GetFileName | ( | const std::string & | filename | ) |
Gets the filename from a full path.
Uses std::filesystem for cross-platform consistency.
filename | The full path to the file. |
Definition at line 19 of file file_util.cc.
Referenced by yaze::gui::ThemeManager::DiscoverAvailableThemeFiles(), yaze::editor::EditorManager::DrawMenuBar(), yaze::editor::AgentChatWidget::LoadAgentSettingsFromProject(), yaze::emu::ui::RenderNavBar(), and yaze::editor::AgentChatWidget::RenderSystemPromptEditor().
std::string yaze::util::LoadFile | ( | const std::string & | filename | ) |
Loads the entire contents of a file into a string.
Throws a std::runtime_error if the file cannot be opened.
filename | The full, absolute path to the file. |
Definition at line 23 of file file_util.cc.
Referenced by yaze::cli::anonymous_namespace{tui.cc}::ApplyBpsPatchComponent(), yaze::editor::AssemblyEditor::ChangeActiveFile(), yaze::cli::handlers::ProjectBuildCommandHandler::Execute(), yaze::editor::UserSettings::Load(), yaze::editor::WorkspaceManager::RefreshPresets(), and yaze::editor::AgentChatWidget::RenderSystemPromptEditor().
std::string yaze::util::LoadFileFromConfigDir | ( | const std::string & | filename | ) |
Loads a file from the user's config directory.
filename | The name of the file inside the config directory. |
Definition at line 38 of file file_util.cc.
References yaze::util::PlatformPaths::GetConfigDirectory().
Referenced by yaze::editor::EditorSelectionDialog::LoadRecentEditors().
void yaze::util::SaveFile | ( | const std::string & | filename, |
const std::string & | contents | ||
) |
Definition at line 56 of file file_util.cc.
References yaze::util::PlatformPaths::GetConfigDirectory().
Referenced by yaze::editor::UserSettings::Save(), yaze::editor::AssemblyEditor::Save(), yaze::editor::EditorSelectionDialog::SaveRecentEditors(), and yaze::editor::WorkspaceManager::SaveWorkspacePreset().
std::string yaze::util::GetResourcePath | ( | const std::string & | resource_path | ) |
Definition at line 70 of file file_util.cc.
References GetBundleResourcePath().
Referenced by yaze::editor::OverworldEditor::ApplyZSCustomOverworldASM(), yaze::gui::ThemeManager::GetThemeSearchPaths(), and yaze::gui::ThemeManager::LoadThemeFromFile().
std::string yaze::util::GetBundleResourcePath | ( | ) |
GetBundleResourcePath returns the path to the bundle resource directory. Specific to MacOS.
Referenced by GetResourcePath(), yaze::AssetLoader::GetSearchPaths(), yaze::gui::ThemeManager::GetThemeSearchPaths(), and yaze::anonymous_namespace{font_loader.cc}::SetFontPath().
|
inline |
Definition at line 115 of file flag.h.
Referenced by main(), and yaze::util::FlagParser::Parse().
std::string yaze::util::HexByte | ( | uint8_t | byte, |
HexStringParams | params | ||
) |
Definition at line 30 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::OverworldEntityRenderer::DrawEntrances(), yaze::editor::DungeonRoomSelector::DrawEntranceSelector(), yaze::editor::OverworldEntityRenderer::DrawExits(), yaze::editor::DungeonRoomSelector::DrawRoomSelector(), yaze::editor::SpriteEditor::DrawSpritesList(), yaze::editor::Tile16Editor::Initialize(), yaze::zelda3::LoadDungeonMaps(), yaze::editor::ReadAllTextData(), yaze::zelda3::Overworld::SaveOverworldMaps(), yaze::test::TEST(), and yaze::editor::OverworldEditor::UpdateUsageStats().
std::string yaze::util::HexWord | ( | uint16_t | word, |
HexStringParams | params | ||
) |
Definition at line 41 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::MessageEditor::DrawDictionary(), yaze::editor::MessageEditor::DrawMessageList(), yaze::editor::ParseSingleMessage(), and yaze::test::TEST().
std::string yaze::util::HexLong | ( | uint32_t | dword, |
HexStringParams | params | ||
) |
Definition at line 52 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::MessageEditor::DrawMessageList(), yaze::zelda3::Overworld::SaveOverworldMaps(), and yaze::test::TEST().
std::string yaze::util::HexLongLong | ( | uint64_t | qword, |
HexStringParams | params | ||
) |
Definition at line 63 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::PopupManager::DrawRomInfoPopup(), and yaze::test::TEST().
|
inline |
Definition at line 116 of file log.h.
References INFO, yaze::util::LogManager::instance(), and yaze::util::LogManager::log().
Referenced by yaze::zelda3::Overworld::AssembleMap16Tiles(), yaze::zelda3::Overworld::AssembleMap32Tiles(), yaze::editor::Tile16Editor::CommitChangesToOverworld(), yaze::editor::Tile16Editor::CyclePalette(), yaze::zelda3::Overworld::DecompressAllMapTilesParallel(), yaze::editor::Tile16Editor::DiscardChanges(), yaze::editor::Tile16Editor::DrawPaletteSettings(), yaze::editor::Tile16Editor::DrawToCurrentTile16(), yaze::zelda3::Overworld::EnsureMapBuilt(), yaze::zelda3::Overworld::LoadOverworldMaps(), yaze::editor::OverworldEditor::LoadScratchToSelection(), yaze::editor::Tile16Editor::LoadTile8(), yaze::editor::ParseMessageToData(), yaze::editor::Tile16Editor::PickTile8FromTile16(), yaze::editor::Tile16Editor::RefreshAllPalettes(), yaze::editor::Tile16Editor::RefreshTile16Blockset(), yaze::editor::Tile16Editor::RegenerateTile16BitmapFromROM(), yaze::zelda3::Overworld::SaveAreaSizes(), yaze::zelda3::Overworld::SaveAreaSpecificBGColors(), yaze::zelda3::Overworld::SaveCustomOverworldASM(), yaze::zelda3::Overworld::SaveEntrances(), yaze::zelda3::Overworld::SaveExits(), yaze::zelda3::Overworld::SaveItems(), yaze::zelda3::Overworld::SaveLargeMaps(), yaze::zelda3::Overworld::SaveLargeMapsExpanded(), yaze::zelda3::Overworld::SaveMap16Tiles(), yaze::zelda3::Overworld::SaveMap32Tiles(), yaze::zelda3::Overworld::SaveMapOverlays(), yaze::zelda3::Overworld::SaveMapProperties(), yaze::zelda3::Overworld::SaveMusic(), yaze::zelda3::Overworld::SaveOverworldMaps(), yaze::zelda3::Overworld::SaveOverworldTilesType(), yaze::editor::Tile16Editor::set_palette(), yaze::editor::Tile16Editor::SetCurrentTile(), yaze::editor::EditorManager::SwitchToSession(), yaze::editor::Tile16Editor::UpdateBlockset(), yaze::editor::Tile16Editor::UpdateROMTile16Data(), yaze::editor::Tile16Editor::UpdateTile16Edit(), and yaze::editor::Tile16Editor::UpdateTile8Palette().
|
inline |
Definition at line 121 of file log.h.
References INFO, yaze::util::LogManager::instance(), and yaze::util::LogManager::log().