Nestopia Core API: Nes::Api::Cartridge::Database

Overview | Project | Class | Tree | Deprecated | Index
| Nestopia Core API
FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## api
Class Nes::Api::Cartridge::Database

class Nes::Api::Cartridge::Database

Database interface

Inner Classes, Typedefs, and Enums
`class` | `Nes::Api::Cartridge::Database::Entry` Database entry.

Constructor Summary
`Database( Core::Machine& instance )` Interface constructor.

Method Summary
`Result` | `Enable( bool state = true )` Enables image corrections.
`Nes::Api::Cartridge::Database::Entry` | `FindEntry( const void* mem, ulong size, Machine::FavoredSystem system ) const` Attempts to locate and return an entry from one of the databases.
`Nes::Api::Cartridge::Database::Entry` | `FindEntry( const Profile::Hash& hash, Machine::FavoredSystem system ) const` Attempts to locate and return an entry from one of the databases.
`bool` | `IsEnabled() const` Checks if image corrections are enabled.
`bool` | `IsLoaded() const` Checks if any database has been loaded into the system.
`Result` | `Load( std::istream& streamInternal, std::istream& streamExternal )` Resets and loads internal and external XML databases.
`Result` | `Load( std::istream& stream )` Resets and loads internal XML database.
`void` | `Unload()` Removes all databases from the system.

Constructor Detail

### Database

    public Database( Core::Machine& instance );

  Interface constructor.

Parameters:
  `instance` - emulator instance

Method Detail

### Enable

    public Result Enable( bool state = true ) throw();

  Enables image corrections.

Parameters:
  `state` - true to enable, default is true
Returns:
  result code

### FindEntry

    public Nes::Api::Cartridge::Database::Entry FindEntry( const void* mem, ulong size, Machine::FavoredSystem system ) const throw();

  Attempts to locate and return an entry from one of the databases.

Parameters:
  `mem` - pointer to memory of combined ROMs
  `size` - size of memory
  `system` - preferred system in case of multiple profiles
Returns:
  entry found

### FindEntry

    public Nes::Api::Cartridge::Database::Entry FindEntry( const Profile::Hash& hash, Machine::FavoredSystem system ) const throw();

  Attempts to locate and return an entry from one of the databases.

Parameters:
  `hash` - hash code of combined ROMs
  `system` - preferred system in case of multiple profiles
Returns:
  entry found

### IsEnabled

    public bool IsEnabled() const throw();

  Checks if image corrections are enabled.

Returns:
  true if enabled

### IsLoaded

    public bool IsLoaded() const throw();

  Checks if any database has been loaded into the system.

Returns:
  true if loaded

### Load

    public Result Load( std::istream& streamInternal, std::istream& streamExternal ) throw();

  Resets and loads internal and external XML databases.

Parameters:
  `streamInternal` - input stream to internal XML database
  `streamExternal` - input stream to external XML database
Returns:
  result code

### Load

    public Result Load( std::istream& stream ) throw();

  Resets and loads internal XML database.

Parameters:
  `stream` - input stream
Returns:
  result code

### Unload

    public void Unload() throw();

  Removes all databases from the system.

Overview | Project | Class | Tree | Deprecated | Index
| Nestopia Core API
FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD