yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_safeguards.h File Reference
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "app/rom.h"
Include dependency graph for editor_safeguards.h:

Go to the source code of this file.

Namespaces

namespace  yaze
 Main namespace for the application.
 
namespace  yaze::editor
 Editors are the view controllers for the application.
 

Macros

#define REQUIRE_ROM_LOADED(rom_ptr, operation)
 
#define CHECK_ROM_STATE(rom_ptr, message)
 

Functions

std::string yaze::editor::GetRomStatusMessage (const Rom *rom)
 
bool yaze::editor::IsRomReadyForEditing (const Rom *rom)
 

Macro Definition Documentation

◆ REQUIRE_ROM_LOADED

#define REQUIRE_ROM_LOADED (   rom_ptr,
  operation 
)
Value:
do { \
if (!(rom_ptr) || !(rom_ptr)->is_loaded()) { \
return absl::FailedPreconditionError( \
absl::StrFormat("%s: ROM not loaded", (operation))); \
} \
} while (0)

Definition at line 12 of file editor_safeguards.h.

◆ CHECK_ROM_STATE

#define CHECK_ROM_STATE (   rom_ptr,
  message 
)
Value:
do { \
if (!(rom_ptr) || !(rom_ptr)->is_loaded()) { \
return absl::FailedPreconditionError(message); \
} \
} while (0)

Definition at line 21 of file editor_safeguards.h.