Delete the now-unused emulator_status stuff

This commit is contained in:
Ilari Liusvaara 2014-04-02 08:43:25 +03:00
parent 3bd8f21369
commit d533647560
4 changed files with 0 additions and 182 deletions

View file

@ -5,15 +5,12 @@
#include "interface/romtype.hpp"
#include "library/keyboard.hpp"
#include "library/messagebuffer.hpp"
#include "library/emustatus.hpp"
#include "library/framebuffer.hpp"
#include <string>
#include <map>
#include <list>
#include <stdexcept>
class emulator_status;
/**
* Information about keypress.
*/
@ -165,12 +162,6 @@ struct platform
* throws std::bad_alloc: Not enough memory.
*/
static std::ostream& out() throw(std::bad_alloc);
/**
* Get emulator status area
*
* returns: Emulator status area.
*/
static emulator_status& get_emustatus() throw();
/**
* Message buffer.
*/

View file

@ -1,99 +0,0 @@
#ifndef _library__emustatus__hpp__included__
#define _library__emustatus__hpp__included__
#include "threads.hpp"
#include <map>
#include <string>
#include "utf8.hpp"
class emulator_status
{
public:
/**
* Constructor.
*
* Throws std::bad_alloc: Not enough memory.
*/
emulator_status() throw(std::bad_alloc);
/**
* Destructor
*/
~emulator_status() throw();
/**
* Insert/Replace key.
*
* Parameter key: Key to insert/replace.
* Parameter value: The value to assign.
* Throws std::bad_alloc: Not enough memory.
*/
void set(const std::string& key, const std::string& value) throw(std::bad_alloc);
/**
* Insert/Replace key.
*
* Parameter key: Key to insert/replace.
* Parameter value: The value to assign.
* Throws std::bad_alloc: Not enough memory.
*/
void set(const std::string& key, const std::u32string& value) throw(std::bad_alloc);
/**
* Has key?
*
* Parameter key: Key to check.
* Returns: True if key exists, false if not.
*/
bool haskey(const std::string& key) throw();
/**
* Erase key.
*
* Parameter key: Key to erase.
*/
void erase(const std::string& key) throw();
/**
* Read key.
*
* Parameter key: The key to read.
* Returns: The value of key ("" if not found).
*/
std::u32string get(const std::string& key) throw(std::bad_alloc);
/**
* Iterator.
*/
struct iterator
{
/**
* Not valid flag.
*/
bool not_valid;
/**
* Key.
*/
std::string key;
/**
* Value.
*/
std::u32string value;
};
/**
* Get first iterator
*
* Returns: Before-the-start iterator.
* Throws std::bad_alloc: Not enough memory.
*/
iterator first() throw(std::bad_alloc);
/**
* Get next value.
*
* Parameter itr: Iterator to advance.
* Returns: True if next value was found, false if not.
* Throws std::bad_alloc: Not enough memory.
*/
bool next(iterator& itr) throw(std::bad_alloc);
private:
emulator_status(const emulator_status&);
emulator_status& operator=(const emulator_status&);
threads::lock lock;
std::map<std::string, std::u32string> content;
};
#endif

View file

@ -94,8 +94,6 @@ namespace
keyboard::invbind ienable_sound(lsnes_mapper, "enable-sound on", "Sound‣Enable");
keyboard::invbind idisable_sound(lsnes_mapper, "enable-sound off", "Sound‣Disable");
emulator_status emustatus;
class window_output
{
public:
@ -149,11 +147,6 @@ namespace
bool sounds_enabled = true;
}
emulator_status& platform::get_emustatus() throw()
{
return emustatus;
}
void platform::sound_enable(bool enable) throw()
{
audioapi_driver_enable(enable);

View file

@ -1,67 +0,0 @@
#include "emustatus.hpp"
emulator_status::emulator_status() throw(std::bad_alloc)
{
}
emulator_status::~emulator_status() throw()
{
}
void emulator_status::set(const std::string& key, const std::string& value) throw(std::bad_alloc)
{
threads::alock h(lock);
content[key] = utf8::to32(value);
}
void emulator_status::set(const std::string& key, const std::u32string& value) throw(std::bad_alloc)
{
threads::alock h(lock);
content[key] = value;
}
bool emulator_status::haskey(const std::string& key) throw()
{
threads::alock h(lock);
return (content.count(key) != 0);
}
void emulator_status::erase(const std::string& key) throw()
{
threads::alock h(lock);
content.erase(key);
}
std::u32string emulator_status::get(const std::string& key) throw(std::bad_alloc)
{
threads::alock h(lock);
return content[key];
}
emulator_status::iterator emulator_status::first() throw(std::bad_alloc)
{
iterator i;
i.not_valid = true;
return i;
}
bool emulator_status::next(iterator& itr) throw(std::bad_alloc)
{
threads::alock h(lock);
std::map<std::string, std::u32string>::iterator j;
if(itr.not_valid)
j = content.lower_bound("");
else
j = content.upper_bound(itr.key);
if(j == content.end()) {
itr.not_valid = true;
itr.key = "";
itr.value = U"";
return false;
} else {
itr.not_valid = false;
itr.key = j->first;
itr.value = j->second;
return true;
}
}