21#include <boost/date_time/posix_time/ptime.hpp>
23#include <unordered_set>
24#include <unordered_map>
29 namespace interprocess
38class OksXmlOutputStream;
39class OksXmlInputStream;
65 static std::string
fill(
const OksFile& file,
bool lock_action,
const std::string& reason)
noexcept;
89 static std::string
fill(
const OksFile& file,
const std::string& action,
const std::string& reason)
noexcept;
110 static std::string
fill(
const std::string& src,
const std::string& dest,
const std::string& reason)
noexcept;
135 static std::string
fill(
const OksFile& file,
const std::string& include_name,
const std::string& reason)
noexcept;
160 static std::string
fill(
const OksFile& file,
const std::string& include_name,
const std::string& reason)
noexcept;
185 static std::string
fill(
const OksFile& file,
const std::string& from,
const std::string& to,
const std::string& reason)
noexcept;
210 static std::string
fill(
const OksFile& file,
const std::string& reason)
noexcept;
235 static std::string
fill(
const OksFile& file,
const std::string& creation_time,
const std::string& reason)
noexcept;
260 static std::string
fill(
const OksFile& file,
const std::string& creation_time,
const std::string& reason)
noexcept;
280 Comment(
const std::string& text,
const std::string& author);
301 void validate(
const std::string& creation_time);
319 return reinterpret_cast<size_t>(x);
362 bool operator() (
const std::string * s1,
const std::string * s2)
const {
367 typedef std::map<const std::string *, OksFile *, SortByName>
Map;
369 typedef std::unordered_set<OksFile *, oks::hash_file_ptr, oks::equal_file_ptr>
Set;
370 typedef std::unordered_map<OksFile *, Set, oks::hash_file_ptr, oks::equal_file_ptr>
IMap;
456 void add_comment(
const std::string& text,
const std::string& author);
471 void modify_comment(
const std::string& creation_time,
const std::string& text,
const std::string& author);
515 void set_type(
const std::string& type);
697 static bool compare(
const char * file1_name,
const char * file2_name);
790 OksFile(std::shared_ptr<OksXmlInputStream>,
const std::string&,
const std::string&,
OksKernel *);
795 void rename(
const std::string& short_name,
const std::string& full_name);
796 void rename(
const std::string& full_name);
Cannot add include file. Such exception is thrown when OKS cannot add include file.
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
Cannot remove include file. Such exception is thrown when OKS cannot remove include file.
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
Cannot rename include file. Such exception is thrown when OKS cannot rename include file.
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
Cannot add include file. Such exception is thrown when OKS cannot add include file.
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.
std::unordered_map< OksFile *, Set, oks::hash_file_ptr, oks::equal_file_ptr > IMap
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
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.
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::unordered_set< OksFile *, oks::hash_file_ptr, oks::equal_file_ptr > Set
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
std::map< std::string, oks::Comment * > p_comments
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.
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
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[]
std::map< const std::string *, OksFile *, SortByName > Map
Provides interface to the OKS kernel.
OksObject describes instance of OksClass.
caught dunedaq::conffwk::Exception exception
FELIX Initialization std::string initerror FELIX queue timed out
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