#include <cstring>
#include <list>
#include <map>
+#include <memory>
#include <set>
#include <sstream>
+#include <utility>
#include "app-core-cpp/app_core_base.hh"
#include "common/glib_private.hh"
#include "common/log_private.hh"
extern "C" void aul_finalize();
-
namespace tizen_cpp {
+
+AppCoreBase* AppCoreBase::context_ = nullptr;
+
namespace {
enum TizenProfile {
impl_->val_ = std::move(val);
}
-AppCoreBase::AppCoreBase() : impl_(std::make_unique<AppCoreBase::Impl>(this)) {}
+AppCoreBase::AppCoreBase()
+ : impl_(std::make_unique<AppCoreBase::Impl>(this)) {
+ if (context_ != nullptr) {
+ _E("Context is already initialized");
+ }
+
+ context_ = this;
+}
+
AppCoreBase::~AppCoreBase() = default;
+AppCoreBase* AppCoreBase::GetContext() {
+ if (context_ == nullptr) {
+ _E("Context is not initialized.");
+ return nullptr;
+ }
+
+ return context_;
+}
+
void AppCoreBase::Impl::ChangeLang() {
const char* lang = getenv("LANG");
if (lang == nullptr)