Namespaces | |
| namespace | anonymous_namespace{bps.cc} |
| namespace | anonymous_namespace{hex.cc} |
| namespace | anonymous_namespace{indexed_png.cc} |
| namespace | anonymous_namespace{rom_hash.cc} |
| namespace | detail |
Classes | |
| class | CrashHandler |
| Manages crash logging for release builds. More... | |
| struct | FileDialogFilter |
| struct | FileDialogOptions |
| 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 | LruCache |
| struct | NoStopStateTag |
| 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 | PngImage |
| A decoded PNG: palette indices for indexed files, RGBA otherwise. More... | |
| struct | RomIdentityHashes |
| struct | SDL_Deleter |
| Deleter for SDL_Window and SDL_Renderer. More... | |
| struct | SDL_Surface_Deleter |
| Custom deleter for SDL_Surface. More... | |
| struct | SDL_Texture_Deleter |
| Custom deleter for SDL_Texture. More... | |
| class | StopSource |
| class | StopToken |
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... | |
| enum class | RomHashMatch { kMismatch , kCrc32 , kLegacyCrc32 , kSha1 } |
Functions | |
| bool | ImageClipboardSupported () |
| absl::Status | SetClipboardPng (const std::vector< uint8_t > &png, const std::string &pasteboard="") |
| Replaces the clipboard contents with one PNG image. | |
| absl::StatusOr< std::vector< uint8_t > > | GetClipboardPng (const std::string &) |
| 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) |
| FileDialogOptions | MakeRomFileDialogOptions (bool include_all_files) |
| 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) |
| bool | ParseHexString (absl::string_view str, uint64_t *out) |
| bool | ParseHexString (absl::string_view str, uint32_t *out) |
| bool | ParseHexString (absl::string_view str, int *out) |
| absl::StatusOr< std::vector< uint8_t > > | EncodeIndexedPng (int width, int height, const std::vector< uint8_t > &indices, const std::vector< std::array< uint8_t, 4 > > &palette) |
| absl::StatusOr< PngImage > | DecodePng (const std::vector< uint8_t > &bytes) |
| absl::StatusOr< std::vector< uint8_t > > | ReadBinaryFile (const std::string &path) |
| absl::Status | WriteBinaryFile (const std::string &path, const std::vector< uint8_t > &bytes) |
| template<typename... Args> | |
| void | logf (const absl::FormatSpec< Args... > &format, Args &&... args) |
| void | logf (absl::string_view message) |
| uint32_t | CalculateCrc32 (const uint8_t *data, size_t size) |
| std::string | ComputeRomHash (const uint8_t *data, size_t size) |
| RomIdentityHashes | ComputeRomIdentityHashes (const uint8_t *data, size_t size) |
| std::string | ComputeSha1Hex (const uint8_t *data, size_t size) |
| Compute SHA-1 hash of data, return lowercase hex string (40 chars). | |
| std::string | ComputeFileSha1Hex (const std::string &path) |
Variables | |
| constexpr NoStopStateTag | kNoStopState {} |
|
strong |
| Enumerator | |
|---|---|
| kUnknown | |
| kMacOS | |
| kiOS | |
| kWindows | |
| kLinux | |
Definition at line 71 of file file_util.h.
|
strong |
|
strong |
| Enumerator | |
|---|---|
| kMismatch | |
| kCrc32 | |
| kLegacyCrc32 | |
| kSha1 | |
Definition at line 15 of file rom_hash.h.
| bool yaze::util::ImageClipboardSupported | ( | ) |
Definition at line 64 of file image_clipboard.mm.
Referenced by yaze::editor::PixelEditorPanel::DrawClipboardControls().
| absl::Status yaze::util::SetClipboardPng | ( | const std::vector< uint8_t > & | , |
| const std::string & | ) |
Replaces the clipboard contents with one PNG image.
Definition at line 66 of file image_clipboard.mm.
Referenced by yaze::editor::PixelEditorPanel::CopyToSystemClipboard().
| absl::StatusOr< std::vector< uint8_t > > yaze::util::GetClipboardPng | ( | const std::string & | pasteboard = "" | ) |
The clipboard's image as PNG bytes. A TIFF-only image (macOS screenshots and many apps) is converted to PNG. NotFound when there is no image.
Definition at line 70 of file image_clipboard.mm.
Referenced by yaze::editor::PixelEditorPanel::PasteFromSystemClipboard().
| 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 75 of file bps.cc.
References CalculateCrc32().
Referenced by yaze::cli::handlers::ProjectBuildCommandHandler::Execute(), and yaze::editor::MenuOrchestrator::OnApplyBpsPatch().

| absl::Status yaze::util::CreateBpsPatch | ( | const std::vector< uint8_t > & | source, |
| const std::vector< uint8_t > & | target, | ||
| std::vector< uint8_t > & | patch ) |
Definition at line 228 of file bps.cc.
References CalculateCrc32().
Referenced by yaze::editor::MenuOrchestrator::OnExportBpsPatch().

| 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::UICoordinator::DrawGlobalSearch(), yaze::emu::ui::RenderNavBar(), and yaze::editor::MenuTilemapEditorUI::SaveCurrentAs().
| 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::editor::ScreenEditor::BuildContextSnapshot(), yaze::editor::AssemblyEditor::ChangeActiveFile(), yaze::gui::ThemeManager::DiscoverAvailableThemeFiles(), yaze::editor::MenuTilemapEditorUI::DrawFileBar(), yaze::editor::AssemblyEditor::DrawFileTabView(), yaze::editor::UICoordinator::DrawGlobalSearch(), yaze::editor::MenuTilemapEditorUI::DrawSourceBar(), yaze::emu::ui::RenderNavBar(), yaze::editor::MenuTilemapEditorUI::ResolvePaletteSource(), and yaze::editor::MenuTilemapEditorUI::SaveCurrentAs().
| 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::editor::AssemblyEditor::ChangeActiveFile(), yaze::editor::CustomCollisionPanel::Draw(), yaze::editor::WaterFillPanel::Draw(), yaze::editor::anonymous_namespace{user_settings.cc}::LoadPreferencesFromIni(), and yaze::editor::WorkspaceManager::RefreshPresets().
| 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(), and yaze::editor::DashboardPanel::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::EditorSelectionDialog::SaveRecentEditors(), yaze::editor::DashboardPanel::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::zelda3::OverworldUpgradeSystem::ApplyZSCustomOverworldASM(), and yaze::gui::ThemeManager::LoadThemeFromFile().

| FileDialogOptions yaze::util::MakeRomFileDialogOptions | ( | bool | include_all_files | ) |
Definition at line 87 of file file_util.cc.
References yaze::util::FileDialogOptions::filters.
Referenced by yaze::editor::PopupManager::DrawNewProjectPopup(), yaze::editor::EditorManager::InitializeSubsystems(), yaze::editor::EditorManager::LoadProjectWithRom(), yaze::editor::EditorManager::LoadRomInternal(), yaze::editor::MenuOrchestrator::OnExportBpsPatch(), and yaze::emu::ui::RenderNavBar().
| std::string yaze::util::GetBundleResourcePath | ( | ) |
GetBundleResourcePath returns the path to the bundle resource directory. Specific to MacOS.
Referenced by GetResourcePath(), yaze::AssetLoader::GetSearchPaths(), and yaze::anonymous_namespace{font_loader.cc}::SetFontPath().
|
inline |
Definition at line 119 of file flag.h.
Referenced by anonymous_namespace{main.cc}::HandleHelpOrVersion(), main(), and yaze::util::FlagParser::Parse().
| std::string yaze::util::HexByte | ( | uint8_t | byte, |
| HexStringParams | params ) |
Definition at line 33 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::ScreenEditor::ChangeDungeonMapFloorCount(), yaze::editor::ScreenEditor::DrawDungeonMapScreen(), yaze::editor::ScreenEditor::DrawDungeonMapsTabs(), yaze::editor::OverworldEntityRenderer::DrawEntrances(), yaze::editor::OverworldEntityRenderer::DrawEntrances(), yaze::editor::OverworldEntityRenderer::DrawExits(), yaze::editor::OverworldEntityRenderer::DrawExits(), yaze::editor::SpriteEditor::DrawSpritesList(), yaze::editor::Tile16Editor::Initialize(), yaze::zelda3::LoadDungeonMaps(), and yaze::zelda3::Overworld::SaveOverworldMaps().
| std::string yaze::util::HexWord | ( | uint16_t | word, |
| HexStringParams | params ) |
Definition at line 44 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::MessageEditor::DrawMessageList().
| std::string yaze::util::HexLong | ( | uint32_t | dword, |
| HexStringParams | params ) |
Definition at line 55 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::MessageEditor::DrawMessageHeader(), yaze::editor::MessageEditor::DrawMessageList(), and yaze::zelda3::Overworld::SaveOverworldMaps().
| std::string yaze::util::HexLongLong | ( | uint64_t | qword, |
| HexStringParams | params ) |
Definition at line 66 of file hex.cc.
References yaze::util::HexStringParams::uppercase.
Referenced by yaze::editor::PopupManager::DrawRomInfoPopup().
| bool yaze::util::ParseHexString | ( | absl::string_view | str, |
| uint64_t * | out ) |
Definition at line 133 of file hex.cc.
Referenced by yaze::cli::handlers::DungeonTileTypesCommandHandler::Execute(), yaze::cli::handlers::OverworldTerrainCatalogCommandHandler::Execute(), yaze::zelda3::anonymous_namespace{menu_tilemap_sources.cc}::ParseAsmNumber(), yaze::core::anonymous_namespace{hack_manifest.cc}::ParseHexAddress(), yaze::cli::anonymous_namespace{gfx_sheet_png_commands.cc}::ParseNumber(), yaze::cli::anonymous_namespace{gfx_sheet_inventory_commands.cc}::ParseSheetList(), yaze::core::anonymous_namespace{hack_manifest.cc}::ParseStrictHexValue(), and yaze::cli::anonymous_namespace{gfx_sheet_png_commands.cc}::ResolvePalette().
| bool yaze::util::ParseHexString | ( | absl::string_view | str, |
| uint32_t * | out ) |
| bool yaze::util::ParseHexString | ( | absl::string_view | str, |
| int * | out ) |
| absl::StatusOr< std::vector< uint8_t > > yaze::util::EncodeIndexedPng | ( | int | width, |
| int | height, | ||
| const std::vector< uint8_t > & | indices, | ||
| const std::vector< std::array< uint8_t, 4 > > & | palette ) |
Encodes an 8-bit indexed PNG. palette holds 1-256 RGBA entries; a tRNS chunk is written when any entry has alpha below 255.
Definition at line 56 of file indexed_png.cc.
Referenced by yaze::editor::EncodeClipboardPng(), yaze::cli::GfxTilemapRenderCommandHandler::Execute(), yaze::zelda3::ExportRoomBackgroundPng(), and yaze::zelda3::ExportSheetBlocksPng().
| absl::StatusOr< PngImage > yaze::util::DecodePng | ( | const std::vector< uint8_t > & | bytes | ) |
Definition at line 112 of file indexed_png.cc.
References yaze::util::PngImage::height, yaze::util::PngImage::indexed, yaze::util::PngImage::indices, yaze::util::PngImage::palette, yaze::util::PngImage::rgba, and yaze::util::PngImage::width.
Referenced by yaze::editor::MenuTilemapEditorUI::DrawOverlayControls(), yaze::cli::GfxImportCommandHandler::Execute(), yaze::cli::GfxRoomImportCommandHandler::Execute(), yaze::editor::MapClipboardPng(), yaze::editor::PreviewRoomPngImport(), and yaze::editor::PreviewSheetPngImport().
| absl::StatusOr< std::vector< uint8_t > > yaze::util::ReadBinaryFile | ( | const std::string & | path | ) |
Definition at line 285 of file indexed_png.cc.
Referenced by yaze::editor::MenuTilemapEditorUI::DrawOverlayControls(), yaze::editor::SheetBrowserPanel::DrawPngTransfer(), yaze::cli::GfxImportCommandHandler::Execute(), and yaze::cli::GfxRoomImportCommandHandler::Execute().
| absl::Status yaze::util::WriteBinaryFile | ( | const std::string & | path, |
| const std::vector< uint8_t > & | bytes ) |
Definition at line 294 of file indexed_png.cc.
Referenced by yaze::editor::SheetBrowserPanel::DrawPngTransfer(), yaze::cli::GfxExportCommandHandler::Execute(), yaze::cli::GfxImportCommandHandler::Execute(), yaze::cli::GfxRoomExportCommandHandler::Execute(), yaze::cli::GfxRoomImportCommandHandler::Execute(), yaze::cli::GfxTilemapRenderCommandHandler::Execute(), yaze::cli::anonymous_namespace{gfx_sheet_png_commands.cc}::ExportRoomBundle(), and yaze::cli::anonymous_namespace{gfx_sheet_png_commands.cc}::WriteJson().
|
inline |
Definition at line 146 of file log.h.
References INFO, yaze::util::LogManager::instance(), and yaze::util::LogManager::log().
Referenced by yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), yaze::editor::Tile16EditSession::ApplyPaletteToAllImpl(), yaze::editor::Tile16EditSession::ApplyPaletteToQuadrantImpl(), yaze::zelda3::Overworld::AssembleMap32Tiles(), yaze::zelda3::Overworld::AutoDetectDiggableTiles(), yaze::editor::Tile16EditSession::CommitAllChanges(), yaze::editor::Tile16EditSession::CommitChangesToOverworld(), yaze::editor::Tile16EditSession::CyclePalette(), yaze::editor::Tile16EditSession::DiscardAllChanges(), yaze::editor::Tile16EditSession::DiscardChanges(), yaze::editor::Tile16EditSession::DiscardCurrentTileChanges(), yaze::editor::Tile16Editor::DrawBrushAndTilePaletteControls(), yaze::editor::Tile16Editor::DrawPaletteSettings(), yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn(), yaze::editor::Tile16Editor::DrawTile8UsageOverlay(), yaze::editor::Tile16EditSession::DrawToCurrentTile16Impl(), yaze::editor::FindMatchingElement(), yaze::editor::Tile16EditSession::HandleTile16CanvasClick(), yaze::editor::Tile16Editor::HandleTile8SourceSelection(), yaze::i18n::LanguageManager::LoadCatalog(), yaze::zelda3::Overworld::LoadOverworldMaps(), yaze::editor::OverworldEditor::LoadScratchToSelection(), yaze::editor::Tile16EditSession::LoadTile8(), yaze::editor::Tile16EditSession::MarkCurrentTileModified(), yaze::editor::LayoutManager::MaybeReapplyStartupLayout(), yaze::editor::ParseMessageToData(), yaze::editor::TilePaintingManager::PickTile16FromHoveredCanvas(), yaze::editor::Tile16EditSession::PickTile8FromTile16(), yaze::zelda3::ReadMap16Tiles(), yaze::editor::Tile16EditSession::RefreshAllPalettes(), yaze::editor::Tile16EditSession::RefreshTile16Blockset(), yaze::editor::Tile16EditSession::RegenerateTile16BitmapFromROM(), yaze::editor::Tile16EditSession::RequestTileSwitch(), yaze::zelda3::Overworld::SaveAreaSizes(), yaze::zelda3::Overworld::SaveAreaSpecificBGColors(), yaze::zelda3::Overworld::SaveCustomOverworldASM(), yaze::zelda3::SaveItems(), yaze::zelda3::Overworld::SaveLargeMaps(), yaze::zelda3::Overworld::SaveLargeMapsExpanded(), yaze::zelda3::Overworld::SaveMap16Tiles(), yaze::zelda3::Overworld::SaveMap32Expanded(), 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::Tile16EditSession::SaveTile16ToROM(), yaze::editor::Tile16EditSession::set_palette(), yaze::editor::Tile16EditSession::SetCurrentTile(), yaze::editor::Tile16Editor::UpdateBlockset(), yaze::editor::Tile16EditSession::UpdateROMTile16Data(), and yaze::editor::Tile16EditSession::UpdateTile8Palette().

|
inline |
Definition at line 152 of file log.h.
References INFO, yaze::util::LogManager::instance(), and yaze::util::LogManager::log().

| uint32_t yaze::util::CalculateCrc32 | ( | const uint8_t * | data, |
| size_t | size ) |
Definition at line 76 of file rom_hash.cc.
Referenced by ApplyBpsPatch(), yaze::zelda3::ApplyDungeonStreamWritePlan(), yaze::util::anonymous_namespace{bps.cc}::CalculateCrc32(), ComputeRomHash(), CreateBpsPatch(), yaze::zelda3::InventoryDungeonStreams(), and yaze::editor::anonymous_namespace{recent_projects_model.cc}::ReadFileCrc32().
| std::string yaze::util::ComputeRomHash | ( | const uint8_t * | data, |
| size_t | size ) |
Definition at line 80 of file rom_hash.cc.
References CalculateCrc32().
Referenced by yaze::editor::anonymous_namespace{dungeon_canvas_issue_report.cc}::BuildReportSessionSummary(), ComputeRomIdentityHashes(), and yaze::editor::SettingsPanel::DrawProjectSettings().

| RomIdentityHashes yaze::util::ComputeRomIdentityHashes | ( | const uint8_t * | data, |
| size_t | size ) |
Definition at line 84 of file rom_hash.cc.
References ComputeRomHash(), and ComputeSha1Hex().
Referenced by yaze::editor::RomSession::CaptureRomIdentity(), and yaze::cli::handlers::ProjectBundleVerifyCommandHandler::Execute().

| std::string yaze::util::ComputeSha1Hex | ( | const uint8_t * | data, |
| size_t | size ) |
Compute SHA-1 hash of data, return lowercase hex string (40 chars).
Definition at line 234 of file rom_hash.cc.
Referenced by yaze::zelda3::BuildGfxSheetInventory(), yaze::zelda3::parity::CaptureRomSha1(), yaze::editor::OverworldEditor::CheckRomReplacement(), yaze::zelda3::atlas::CollectDungeonAtlasInput(), ComputeFileSha1Hex(), ComputeRomIdentityHashes(), yaze::zelda3::parity::DifferenceDigest(), yaze::cli::handlers::ProjectBundleVerifyCommandHandler::Execute(), yaze::editor::OverworldEditor::Load(), yaze::zelda3::parity::LoadVerifiedCaptureSet(), and yaze::editor::ObjectCoveragePanel::RebuildIndex().
| std::string yaze::util::ComputeFileSha1Hex | ( | const std::string & | path | ) |
Compute SHA-1 hash of a file on disk, return lowercase hex string. Returns empty string on read error.
Definition at line 251 of file rom_hash.cc.
References ComputeSha1Hex().
Referenced by yaze::cli::handlers::anonymous_namespace{mesen_handlers.cc}::BuildSavestateMetadata(), yaze::cli::handlers::anonymous_namespace{mesen_handlers.cc}::ComputeSavestateFreshness(), and yaze::cli::handlers::ProjectBundleVerifyCommandHandler::Execute().

|
inlineconstexpr |
Definition at line 11 of file stop_token.h.