mirror of https://gitlab.com/cppit/jucipp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
920 B
31 lines
920 B
|
11 years ago
|
#ifndef JUCI_SINGLETONS_H_
|
||
|
|
#define JUCI_SINGLETONS_H_
|
||
|
|
|
||
|
|
#include "source.h"
|
||
|
|
#include "directories.h"
|
||
|
|
#include "terminal.h"
|
||
|
11 years ago
|
#include "notebook.h"
|
||
|
|
#include "menu.h"
|
||
|
11 years ago
|
#include <string>
|
||
|
11 years ago
|
|
||
|
11 years ago
|
class Singleton {
|
||
|
|
public:
|
||
|
11 years ago
|
class Config {
|
||
|
|
public:
|
||
|
11 years ago
|
static Source::Config *source() {return source_.get();}
|
||
|
|
static Terminal::Config *terminal() {return terminal_.get();}
|
||
|
|
static Directories::Config *directories() {return directories_.get();}
|
||
|
11 years ago
|
private:
|
||
|
|
static std::unique_ptr<Source::Config> source_;
|
||
|
11 years ago
|
static std::unique_ptr<Terminal::Config> terminal_;
|
||
|
|
static std::unique_ptr<Directories::Config> directories_;
|
||
|
11 years ago
|
};
|
||
|
11 years ago
|
static std::string config_dir() { return std::string(getenv("HOME")) + "/.juci/config/"; }
|
||
|
|
static std::string log_dir() { return std::string(getenv("HOME")) + "/.juci/log/"; }
|
||
|
11 years ago
|
static Terminal *terminal();
|
||
|
11 years ago
|
private:
|
||
|
11 years ago
|
static std::unique_ptr<Terminal> terminal_;
|
||
|
11 years ago
|
};
|
||
|
11 years ago
|
|
||
|
|
#endif // JUCI_SINGLETONS_H_
|