#include <msp/io/print.h>
#include <msp/strings/utils.h>
#include "application.h"
+#include "except.h"
#include "getopt.h"
using namespace std;
Application::Application(const string &n)
{
if(_app)
- throw logic_error("instance already exists");
+ throw already_called("Application::Application");
if(!n.empty())
_name = n;
void Application::set_startup_info(const char *argv0, void *data)
{
if(_argv0)
- throw logic_error("startup info already set");
+ throw already_called("Application::set_startup_info");
static FS::Path exe;
_data = data;
}
+void *Application::get_data()
+{
+ return _data;
+}
+
+const char *Application::get_argv0()
+{
+ return _argv0;
+}
+
+const std::string &Application::get_name()
+{
+ return _name;
+}
+
int Application::main()
{
done = false;
Application::Starter::Starter()
{
if(_starter)
- throw logic_error("Can't create more than one Starter instance");
+ throw already_called("Application::Starter::Starter");
_starter = this;
}