26#include <boost/date_time/posix_time/ptime.hpp>
28#include <unordered_map>
29#include <unordered_set>
40class OksXmlOutputStream;
41class OksXmlInputStream;
68 static std::string
fill(
const OksFile& file,
bool lock_action,
const std::string& reason)
noexcept;
81 :
exception(
fill(file, action, reason.what()), reason.level() + 1)
94 static std::string
fill(
const OksFile& file,
const std::string& action,
const std::string& reason)
noexcept;
106 FileCompareError(
const std::string& src,
const std::string& dest,
const std::string& reason) noexcept
114 static std::string
fill(
const std::string& src,
const std::string& dest,
const std::string& reason)
noexcept;
128 :
exception(
fill(file, include_name, reason.what()), reason.level() + 1)
141 static std::string
fill(
const OksFile& file,
const std::string& include_name,
const std::string& reason)
noexcept;
155 :
exception(
fill(file, include_name, reason.what()), reason.level() + 1)
168 static std::string
fill(
const OksFile& file,
const std::string& include_name,
const std::string& reason)
noexcept;
182 const std::string& from,
183 const std::string&
to,
191 const std::string& from,
192 const std::string&
to,
193 const std::string& reason) noexcept
202 const std::string& from,
203 const std::string&
to,
204 const std::string& reason)
noexcept;
231 static std::string
fill(
const OksFile& file,
const std::string& reason)
noexcept;
245 :
exception(
fill(file, creation_time, reason.what()), reason.level() + 1)
258 static std::string
fill(
const OksFile& file,
const std::string& creation_time,
const std::string& reason)
noexcept;
272 :
exception(
fill(file, creation_time, reason.what()), reason.level() + 1)
285 static std::string
fill(
const OksFile& file,
const std::string& creation_time,
const std::string& reason)
noexcept;
304 Comment(
const std::string& text,
const std::string& author);
323 void validate(
const std::string& creation_time);
379 bool operator()(
const std::string* s1,
const std::string* s2)
const {
return *s1 < *s2; }
382 typedef std::map<const std::string*, OksFile*, SortByName>
Map;
384 typedef std::unordered_set<OksFile*, oks::hash_file_ptr, oks::equal_file_ptr>
Set;
385 typedef std::unordered_map<OksFile*, Set, oks::hash_file_ptr, oks::equal_file_ptr>
IMap;
466 void add_comment(
const std::string& text,
const std::string& author);
481 void modify_comment(
const std::string& creation_time,
const std::string& text,
const std::string& author);
687 static bool compare(
const char* file1_name,
const char* file2_name);
770 OksFile(std::shared_ptr<OksXmlInputStream>,
const std::string&,
const std::string&,
OksKernel*);
775 void rename(
const std::string& short_name,
const std::string& full_name);
776 void rename(
const std::string& full_name);
FailedAddInclude(const OksFile &file, const std::string &include_name, const exception &reason) noexcept
FailedAddInclude(const OksFile &file, const std::string &include_name, const std::string &reason) noexcept
virtual ~FailedAddInclude() noexcept
static std::string fill(const OksFile &file, const std::string &include_name, const std::string &reason) noexcept
FailedRemoveInclude(const OksFile &file, const std::string &include_name, const exception &reason) noexcept
FailedRemoveInclude(const OksFile &file, const std::string &include_name, const std::string &reason) noexcept
virtual ~FailedRemoveInclude() noexcept
static std::string fill(const OksFile &file, const std::string &include_name, const std::string &reason) noexcept
FailedRenameInclude(const OksFile &file, const std::string &from, const std::string &to, const std::string &reason) noexcept
static std::string fill(const OksFile &file, const std::string &from, const std::string &to, const std::string &reason) noexcept
virtual ~FailedRenameInclude() noexcept
FailedRenameInclude(const OksFile &file, const std::string &from, const std::string &to, const exception &reason) noexcept
FileChangeError(const OksFile &file, const std::string &action, const exception &reason) noexcept
virtual ~FileChangeError() noexcept
FileChangeError(const OksFile &file, const std::string &action, const std::string &reason) noexcept
static std::string fill(const OksFile &file, const std::string &action, const std::string &reason) noexcept
FileCompareError(const std::string &src, const std::string &dest, const std::string &reason) noexcept
virtual ~FileCompareError() noexcept
static std::string fill(const std::string &src, const std::string &dest, const std::string &reason) noexcept
virtual ~FileLockError() noexcept
FileLockError(const OksFile &file, bool lock_action, const std::string &reason) noexcept
static std::string fill(const OksFile &file, bool lock_action, const std::string &reason) noexcept
Provides interface to the OKS XML schema and data files.
static bool compare(const char *file1_name, const char *file2_name)
Compare two files.
static const char xml_schema_file_dtd[]
bool compare(const char *name) const
Compare with another file.
std::shared_ptr< boost::interprocess::file_lock > p_lock
const std::string & get_created_by() const
std::string p_lock_file_name
std::list< std::string >::iterator find_include_file(const std::string &)
static const char xml_comments_tag[]
const std::string & get_logical_name() const
std::map< std::string, oks::Comment * > p_comments
void unlock()
Unlock OKS file.
void add_include_file(const std::string &name)
Add include file.
time_t p_repository_last_modified
OksFile(const std::string &, const std::string &, const std::string &, const std::string &, OksKernel *)
oks::Comment * get_comment(const std::string &creation_time) noexcept
long get_number_of_items() const
void get_all_include_files(const OksKernel *kernel, std::set< OksFile * > &out)
Get all include files.
void lock()
Lock OKS file.
friend struct OksLoadObjectsJob
void write(OksXmlOutputStream &)
void set_type(const std::string &type)
Set file type.
static void set_nolock_mode(bool nl)
void init_lock_name() const
bool get_lock_string(std::string &info) const
Return lock status of OKS file and if the file is locked, get information string about process which ...
static const char xml_data_file_dtd[]
std::string make_repository_name() const
const std::string & get_created_on() const
bool is_locked() const
Return lock status of OKS file.
static bool p_nolock_mode
const std::string & get_type() const
const std::string & get_short_file_name() const
boost::posix_time::ptime p_last_modification_time
const std::list< std::string > & get_include_files() const
Get directly include files.
std::list< std::string > p_list_of_include_files
boost::posix_time::ptime p_creation_time
std::string p_logical_name
const std::string & get_repository_name() const
Get name of file inside repository.
void remove_comment(const std::string &creation_time)
Modify existing comment.
void set_logical_name(const std::string &name)
Set logical name of file.
std::string p_repository_name
std::string p_last_modified_by
void add_comment(const std::string &text, const std::string &author)
Add new comment to file.
std::map< const std::string *, OksFile *, SortByName > Map
void update_status_of_file(bool update_local=true, bool update_repository=true)
Update status of file.
const std::string & get_last_modified_by() const
bool is_updated() const
Return update status of OKS file.
const OksFile * get_parent() const
Return parent including given file.
bool is_read_only() const
Return read-only status of OKS file.
const boost::posix_time::ptime get_last_modification_time() const
bool is_repository_file() const
Get information about repository, the file belongs to.
const std::string & get_oks_format() const
void clear_comments() noexcept
static const char xml_file_tag[]
OksFile * check_parent(const OksFile *parent_h)
Set given parent, if this file is not yet included.
const OksFile * p_included_by
static const char xml_comment_tag[]
std::string p_last_modified_on
const std::string & get_lock_file() const
std::unordered_map< OksFile *, Set, oks::hash_file_ptr, oks::equal_file_ptr > IMap
std::unordered_set< OksFile *, oks::hash_file_ptr, oks::equal_file_ptr > Set
void modify_comment(const std::string &creation_time, const std::string &text, const std::string &author)
const std::string & get_full_file_name() const
const std::string & get_last_modified_on() const
void rename_include_file(const std::string &from, const std::string &to)
Rename include file.
static const char xml_file_header[]
FileStatus get_status_of_file() const
Return update status of file.
static const char xml_include_tag[]
void rename(const std::string &short_name, const std::string &full_name)
const std::map< std::string, oks::Comment * > & get_comments() const
const std::string & get_well_formed_name() const
Get well-formed file name.
void remove_include_file(const std::string &name)
Remove include file.
const boost::posix_time::ptime get_creation_time() const
static const char xml_info_tag[]
Provides interface to the OKS kernel.
exception(const std::string &what_arg, int level_arg) noexcept
FELIX Initialization std::string initerror FELIX queue timed out
Both frame_count_limit and tp_count_limit were set to(disabled) in the TPCRawDataProcessor " "config. TPs will not send."
bool operator()(const std::string *s1, const std::string *s2) const
bool operator()(const OksFile *__x, const OksFile *__y) const
size_t operator()(const OksFile *x) const