Skip to content

MediaError ​

cpp
#include <Media/MediaError.h>
cpp
struct MediaError

Defined in Media/MediaError.h:24

Exception thrown if a media file is invalid or not supported.

Media files are ROMs, snapshots, cartridges, disk images, and similar files. The error code (see fault()) is one of the constants below.

Public Methods ​

ReturnNameDescription
const char *errstr virtual const inline noexcept overrideReturns the name of the error code.
MediaError explicitCreates an error with an error code and a descriptive string.
MediaError inline explicitCreates an error with an error code and a descriptive string.
MediaError inline explicitCreates an error with an error code and a file path.
MediaError inline explicitCreates an error with an error code and a number.
MediaError inline explicitCreates an error with an error code.

errstr ​

virtual const inline noexcept override

cpp
virtual inline const char * errstr() const noexcept override

Defined in Media/MediaError.h:44

Returns the name of the error code.

Reimplements ​


MediaError ​

explicit

cpp
explicit MediaError(long fault, const string & s)

Defined in Media/MediaError.h:66

Creates an error with an error code and a descriptive string.


MediaError ​

inline explicit

cpp
inline explicit MediaError(long fault, const char * s)

Defined in Media/MediaError.h:68

Creates an error with an error code and a descriptive string.


MediaError ​

inline explicit

cpp
inline explicit MediaError(long fault, const fs::path & p)

Defined in Media/MediaError.h:70

Creates an error with an error code and a file path.


MediaError ​

inline explicit

cpp
inline explicit MediaError(long fault, std::integral auto v)

Defined in Media/MediaError.h:72

Creates an error with an error code and a number.


MediaError ​

inline explicit

cpp
inline explicit MediaError(long fault)

Defined in Media/MediaError.h:74

Creates an error with an error code.

Public Static Attributes ​

ReturnNameDescription
longOK static constexprNo error.
longUNKNOWN static constexprUnclassified.
longSNAP_TOO_OLD static constexprSnapshot was created with an older version.
longSNAP_TOO_NEW static constexprSnapshot was created with a later version.
longSNAP_IS_BETA static constexprSnapshot was created with a beta release.
longSNAP_CORRUPTED static constexprSnapshot data is corrupted.
longCRT_NO_CARTRIDGE static constexprNo cartridge attached.
longCRT_UNKNOWN static constexprUnknown cartridge type.
longCRT_UNSUPPORTED static constexprUnsupported cartridge type.
longCRT_TOO_MANY_PACKETS static constexprCRT file contains too many Rom packets.
longCRT_CORRUPTED_PACKET static constexprCRT file contains a corrupted Rom package.

OK ​

static constexpr

cpp
long OK =  0

Defined in Media/MediaError.h:26

No error.


UNKNOWN ​

static constexpr

cpp
long UNKNOWN =  1

Defined in Media/MediaError.h:27

Unclassified.


SNAP_TOO_OLD ​

static constexpr

cpp
long SNAP_TOO_OLD = 10

Defined in Media/MediaError.h:30

Snapshot was created with an older version.


SNAP_TOO_NEW ​

static constexpr

cpp
long SNAP_TOO_NEW = 11

Defined in Media/MediaError.h:31

Snapshot was created with a later version.


SNAP_IS_BETA ​

static constexpr

cpp
long SNAP_IS_BETA = 12

Defined in Media/MediaError.h:32

Snapshot was created with a beta release.


SNAP_CORRUPTED ​

static constexpr

cpp
long SNAP_CORRUPTED = 13

Defined in Media/MediaError.h:33

Snapshot data is corrupted.


CRT_NO_CARTRIDGE ​

static constexpr

cpp
long CRT_NO_CARTRIDGE = 20

Defined in Media/MediaError.h:36

No cartridge attached.


CRT_UNKNOWN ​

static constexpr

cpp
long CRT_UNKNOWN = 21

Defined in Media/MediaError.h:37

Unknown cartridge type.


CRT_UNSUPPORTED ​

static constexpr

cpp
long CRT_UNSUPPORTED = 22

Defined in Media/MediaError.h:38

Unsupported cartridge type.


CRT_TOO_MANY_PACKETS ​

static constexpr

cpp
long CRT_TOO_MANY_PACKETS = 23

Defined in Media/MediaError.h:39

CRT file contains too many Rom packets.


CRT_CORRUPTED_PACKET ​

static constexpr

cpp
long CRT_CORRUPTED_PACKET = 24

Defined in Media/MediaError.h:40

CRT file contains a corrupted Rom package.