63 {
64 static std::mutex s_mutex;
65
66 try
67 {
68 auto start_usage = std::chrono::steady_clock::now();
69
71
73
75 {
76 std::lock_guard lock(s_mutex);
77
79 {
81
83 {
84 s_load_error +=
"the schema contains dangling references to non-loaded classes:\n";
86 }
87
89 {
90 s_load_error +=
"the data contain dangling references to non-loaded objects:\n";
92 }
93 }
94 }
95
96 static std::mutex s_log_mutex;
97 std::lock_guard scoped_lock(s_log_mutex);
98
99 log_timestamp() <<
"validated file \"" <<
m_file_name <<
"\" in " << std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now()-start_usage).count() / 1000. <<
" ms\n";
100 }
101 catch (std::exception& ex)
102 {
103 std::lock_guard lock(s_mutex);
104
106 {
109
112
113 std::size_t pos;
114 while ((pos =
s_load_error.find(user_repository)) != std::string::npos)
116 }
117 }
118 }
const std::string & get_user_repository_root() const
Get user OKS repository root.
OksFile * load_file(const std::string &name, bool bind=true)
Load OKS database file.
const std::string & get_bind_classes_status() const noexcept
Return status of oks classes binding.
void set_silence_mode(const bool b)
Set status of silence mode. To switch 'On'/'Off' use the method's parameter:
const std::string & get_bind_objects_status() const noexcept
Return status of oks objects binding.
std::ostream & log_timestamp(__LogSeverity__ severity=Log)
static void init_file_load_error(const std::string &file)