refactor
This commit is contained in:
parent
163549098d
commit
ca834dd119
@ -27,13 +27,13 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE3(fuse_event, debug, true,
|
E_SIMPLE3(fuse_event, debug, true,
|
||||||
std::string, function, func, E_STRING,
|
std::string, function, func, E_FROM_STRING,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
int, result, res, E_FROM_INT32
|
int, result, res, E_FROM_INT32
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(fuse_args_parsed, info, true,
|
E_SIMPLE1(fuse_args_parsed, info, true,
|
||||||
std::string, arguments, args, E_STRING
|
std::string, arguments, args, E_FROM_STRING
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
@ -24,48 +24,26 @@
|
|||||||
|
|
||||||
#include "events/event.hpp"
|
#include "events/event.hpp"
|
||||||
#include "events/t_event_system.hpp"
|
#include "events/t_event_system.hpp"
|
||||||
#include "utils/string.hpp"
|
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
using event_system = t_event_system<event>;
|
using event_system = t_event_system<event>;
|
||||||
using event_consumer = event_system::event_consumer;
|
using event_consumer = event_system::event_consumer;
|
||||||
|
|
||||||
#define E_CAST(t) ((std::string)t)
|
#define E_FROM_API_FILE_ERROR(e) api_error_to_string(e)
|
||||||
#define E_DOUBLE(d) std::to_string(d)
|
#define E_FROM_BOOL(t) std::to_string(t)
|
||||||
#define E_DOUBLE_PRECISE(dbl_val) \
|
#define E_FROM_CURL_CODE(t) std::string(curl_easy_strerror(t))
|
||||||
|
#define E_FROM_DOUBLE(d) std::to_string(d)
|
||||||
|
#define E_FROM_DOUBLE_PRECISE(dbl_val) \
|
||||||
([](const double &d) -> std::string { \
|
([](const double &d) -> std::string { \
|
||||||
std::stringstream ss; \
|
std::stringstream ss; \
|
||||||
ss << std::fixed << std::setprecision(2) << d; \
|
ss << std::fixed << std::setprecision(2) << d; \
|
||||||
return ss.str(); \
|
return ss.str(); \
|
||||||
})(dbl_val)
|
})(dbl_val)
|
||||||
#define E_FROM_BOOL(t) std::to_string(t)
|
|
||||||
#define E_FROM_EXCEPTION(e) std::string(e.what() ? e.what() : "")
|
|
||||||
#define E_FROM_INT32(t) std::to_string(t)
|
#define E_FROM_INT32(t) std::to_string(t)
|
||||||
#define E_FROM_INT64(t) std::to_string(t)
|
|
||||||
#define E_FROM_UINT16(t) std::to_string(t)
|
|
||||||
#define E_FROM_STRING_ARRAY(a) \
|
|
||||||
([](const auto &array) -> std::string { \
|
|
||||||
std::stringstream ret; \
|
|
||||||
for (const auto &item : array) { \
|
|
||||||
ret << (std::string(item) + " "); \
|
|
||||||
} \
|
|
||||||
return std::string(ret).TrimRight(); \
|
|
||||||
})(a)
|
|
||||||
|
|
||||||
#define E_PERCENT(d) \
|
|
||||||
([](const double &d) -> std::string { \
|
|
||||||
std::stringstream ss; \
|
|
||||||
ss << std::fixed << std::setprecision(2) << d; \
|
|
||||||
ss << "%"; \
|
|
||||||
return ss; \
|
|
||||||
})(d)
|
|
||||||
#define E_STRING(t) t
|
|
||||||
#define E_FROM_CURL_CODE(t) std::string(curl_easy_strerror(t))
|
|
||||||
#define E_FROM_UINT8(t) std::to_string(t)
|
|
||||||
#define E_FROM_UINT32(t) std::to_string(t)
|
|
||||||
#define E_FROM_UINT64(t) std::to_string(t)
|
|
||||||
#define E_FROM_SIZE_T(t) std::to_string(t)
|
#define E_FROM_SIZE_T(t) std::to_string(t)
|
||||||
#define E_FROM_API_FILE_ERROR(e) api_error_to_string(e)
|
#define E_FROM_STRING(t) t
|
||||||
|
#define E_FROM_UINT16(t) std::to_string(t)
|
||||||
|
#define E_FROM_UINT64(t) std::to_string(t)
|
||||||
|
|
||||||
#define E_PROP(type, name, short_name, ts) \
|
#define E_PROP(type, name, short_name, ts) \
|
||||||
private: \
|
private: \
|
||||||
|
@ -29,264 +29,264 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE2(curl_error, error, true,
|
E_SIMPLE2(curl_error, error, true,
|
||||||
std::string, url, url, E_STRING,
|
std::string, url, url, E_FROM_STRING,
|
||||||
CURLcode, res, res, E_FROM_CURL_CODE
|
CURLcode, res, res, E_FROM_CURL_CODE
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(debug_log, debug, true,
|
E_SIMPLE3(debug_log, debug, true,
|
||||||
std::string, function, func, E_STRING,
|
std::string, function, func, E_FROM_STRING,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, data, data, E_STRING
|
std::string, data, data, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(directory_removed, info, true,
|
E_SIMPLE1(directory_removed, info, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(directory_removed_externally, warn, true,
|
E_SIMPLE2(directory_removed_externally, warn, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(directory_remove_failed, error, true,
|
E_SIMPLE2(directory_remove_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(drive_mount_failed, error, true,
|
E_SIMPLE2(drive_mount_failed, error, true,
|
||||||
std::string, location, loc, E_STRING,
|
std::string, location, loc, E_FROM_STRING,
|
||||||
std::string, result, res, E_STRING
|
std::string, result, res, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(drive_mounted, info, true,
|
E_SIMPLE1(drive_mounted, info, true,
|
||||||
std::string, location, loc, E_STRING
|
std::string, location, loc, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(drive_mount_result, info, true,
|
E_SIMPLE1(drive_mount_result, info, true,
|
||||||
std::string, result, res, E_STRING
|
std::string, result, res, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(drive_unmount_pending, info, true,
|
E_SIMPLE1(drive_unmount_pending, info, true,
|
||||||
std::string, location, loc, E_STRING
|
std::string, location, loc, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(drive_unmounted, info, true,
|
E_SIMPLE1(drive_unmounted, info, true,
|
||||||
std::string, location, loc, E_STRING
|
std::string, location, loc, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(event_level_changed, info, true,
|
E_SIMPLE1(event_level_changed, info, true,
|
||||||
std::string, new_event_level, level, E_STRING
|
std::string, new_event_level, level, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(failed_upload_queued, error, true,
|
E_SIMPLE1(failed_upload_queued, error, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(failed_upload_removed, warn, true,
|
E_SIMPLE1(failed_upload_removed, warn, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(failed_upload_retry, info, true,
|
E_SIMPLE1(failed_upload_retry, info, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(file_get_failed, error, true,
|
E_SIMPLE2(file_get_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(file_get_api_list_failed, error, true,
|
E_SIMPLE1(file_get_api_list_failed, error, true,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(file_pinned, info, true,
|
E_SIMPLE1(file_pinned, info, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(file_read_bytes_failed, error, true,
|
E_SIMPLE3(file_read_bytes_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING,
|
std::string, error, err, E_FROM_STRING,
|
||||||
std::size_t, retry, retry, E_FROM_SIZE_T
|
std::size_t, retry, retry, E_FROM_SIZE_T
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(file_removed, debug, true,
|
E_SIMPLE1(file_removed, debug, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(file_removed_externally, warn, true,
|
E_SIMPLE2(file_removed_externally, warn, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(file_remove_failed, error, true,
|
E_SIMPLE2(file_remove_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(file_rename_failed, error, true,
|
E_SIMPLE3(file_rename_failed, error, true,
|
||||||
std::string, from_api_path, FROM, E_STRING,
|
std::string, from_api_path, FROM, E_FROM_STRING,
|
||||||
std::string, to_api_path, TO, E_STRING,
|
std::string, to_api_path, TO, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(file_get_size_failed, error, true,
|
E_SIMPLE2(file_get_size_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(filesystem_item_added, debug, true,
|
E_SIMPLE3(filesystem_item_added, debug, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, parent, parent, E_STRING,
|
std::string, parent, parent, E_FROM_STRING,
|
||||||
bool, directory, dir, E_FROM_BOOL
|
bool, directory, dir, E_FROM_BOOL
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE4(filesystem_item_closed, trace, true,
|
E_SIMPLE4(filesystem_item_closed, trace, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
bool, directory, dir, E_FROM_BOOL,
|
bool, directory, dir, E_FROM_BOOL,
|
||||||
bool, changed, changed, E_FROM_BOOL
|
bool, changed, changed, E_FROM_BOOL
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE5(filesystem_item_handle_closed, trace, true,
|
E_SIMPLE5(filesystem_item_handle_closed, trace, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::uint64_t, handle, handle, E_FROM_UINT64,
|
std::uint64_t, handle, handle, E_FROM_UINT64,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
bool, directory, dir, E_FROM_BOOL,
|
bool, directory, dir, E_FROM_BOOL,
|
||||||
bool, changed, changed, E_FROM_BOOL
|
bool, changed, changed, E_FROM_BOOL
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE4(filesystem_item_handle_opened, trace, true,
|
E_SIMPLE4(filesystem_item_handle_opened, trace, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::uint64_t, handle, handle, E_FROM_UINT64,
|
std::uint64_t, handle, handle, E_FROM_UINT64,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
bool, directory, dir, E_FROM_BOOL
|
bool, directory, dir, E_FROM_BOOL
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(filesystem_item_evicted, info, true,
|
E_SIMPLE2(filesystem_item_evicted, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(filesystem_item_opened, trace, true,
|
E_SIMPLE3(filesystem_item_opened, trace, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
bool, directory, dir, E_FROM_BOOL
|
bool, directory, dir, E_FROM_BOOL
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(file_unpinned, info, true,
|
E_SIMPLE1(file_unpinned, info, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE4(file_upload_completed, info, true,
|
E_SIMPLE4(file_upload_completed, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
api_error, result, res, E_FROM_API_FILE_ERROR,
|
api_error, result, res, E_FROM_API_FILE_ERROR,
|
||||||
bool, cancelled, cancel, E_FROM_BOOL
|
bool, cancelled, cancel, E_FROM_BOOL
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(file_upload_failed, error, true,
|
E_SIMPLE3(file_upload_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(file_upload_not_found, warn, true,
|
E_SIMPLE2(file_upload_not_found, warn, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(file_upload_queued, info, true,
|
E_SIMPLE2(file_upload_queued, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(file_upload_removed, debug, true,
|
E_SIMPLE1(file_upload_removed, debug, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(file_upload_retry, info, true,
|
E_SIMPLE3(file_upload_retry, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
api_error, result, res, E_FROM_API_FILE_ERROR
|
api_error, result, res, E_FROM_API_FILE_ERROR
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(file_upload_started, info, true,
|
E_SIMPLE2(file_upload_started, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(orphaned_file_deleted, warn, true,
|
E_SIMPLE1(orphaned_file_deleted, warn, true,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(orphaned_file_detected, warn, true,
|
E_SIMPLE1(orphaned_file_detected, warn, true,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(orphaned_file_processing_failed, error, true,
|
E_SIMPLE3(orphaned_file_processing_failed, error, true,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
std::string, dest, dest, E_STRING,
|
std::string, dest, dest, E_FROM_STRING,
|
||||||
std::string, result, res, E_STRING
|
std::string, result, res, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(orphaned_source_file_detected, info, true,
|
E_SIMPLE1(orphaned_source_file_detected, info, true,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(orphaned_source_file_removed, info, true,
|
E_SIMPLE1(orphaned_source_file_removed, info, true,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(polling_item_begin, debug, true,
|
E_SIMPLE1(polling_item_begin, debug, true,
|
||||||
std::string, item_name, item, E_STRING
|
std::string, item_name, item, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(polling_item_end, debug, true,
|
E_SIMPLE1(polling_item_end, debug, true,
|
||||||
std::string, item_name, item, E_STRING
|
std::string, item_name, item, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(provider_offline, error, true,
|
E_SIMPLE2(provider_offline, error, true,
|
||||||
std::string, host_name_or_ip, host, E_STRING,
|
std::string, host_name_or_ip, host, E_FROM_STRING,
|
||||||
std::uint16_t, port, port, E_FROM_UINT16
|
std::uint16_t, port, port, E_FROM_UINT16
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(provider_upload_begin, info, true,
|
E_SIMPLE2(provider_upload_begin, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING
|
std::string, source, src, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(provider_upload_end, info, true,
|
E_SIMPLE3(provider_upload_end, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, source, src, E_STRING,
|
std::string, source, src, E_FROM_STRING,
|
||||||
api_error, result, res, E_FROM_API_FILE_ERROR
|
api_error, result, res, E_FROM_API_FILE_ERROR
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(repertory_exception, error, true,
|
E_SIMPLE2(repertory_exception, error, true,
|
||||||
std::string, function, func, E_STRING,
|
std::string, function, func, E_FROM_STRING,
|
||||||
std::string, message, msg, E_STRING
|
std::string, message, msg, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(rpc_server_exception, error, true,
|
E_SIMPLE1(rpc_server_exception, error, true,
|
||||||
std::string, exception, exception, E_STRING
|
std::string, exception, exception, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(service_shutdown_begin, debug, true,
|
E_SIMPLE1(service_shutdown_begin, debug, true,
|
||||||
std::string, service, svc, E_STRING
|
std::string, service, svc, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(service_shutdown_end, debug, true,
|
E_SIMPLE1(service_shutdown_end, debug, true,
|
||||||
std::string, service, svc, E_STRING
|
std::string, service, svc, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(service_started, debug, true,
|
E_SIMPLE1(service_started, debug, true,
|
||||||
std::string, service, svc, E_STRING
|
std::string, service, svc, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE(unmount_requested, info, true);
|
E_SIMPLE(unmount_requested, info, true);
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
E_SIMPLE2(unmount_result, info, true,
|
E_SIMPLE2(unmount_result, info, true,
|
||||||
std::string, location, loc, E_STRING,
|
std::string, location, loc, E_FROM_STRING,
|
||||||
std::string, result, res, E_STRING
|
std::string, result, res, E_FROM_STRING
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -28,21 +28,21 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE2(download_begin, info, true,
|
E_SIMPLE2(download_begin, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING
|
std::string, dest_path, dest, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE5(download_chunk_begin, debug, true,
|
E_SIMPLE5(download_chunk_begin, debug, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING,
|
std::string, dest_path, dest, E_FROM_STRING,
|
||||||
std::size_t, chunk, chunk, E_FROM_SIZE_T,
|
std::size_t, chunk, chunk, E_FROM_SIZE_T,
|
||||||
std::size_t, total, total, E_FROM_SIZE_T,
|
std::size_t, total, total, E_FROM_SIZE_T,
|
||||||
std::size_t, complete, complete, E_FROM_SIZE_T
|
std::size_t, complete, complete, E_FROM_SIZE_T
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE6(download_chunk_end, debug, true,
|
E_SIMPLE6(download_chunk_end, debug, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING,
|
std::string, dest_path, dest, E_FROM_STRING,
|
||||||
std::size_t, chunk, chunk, E_FROM_SIZE_T,
|
std::size_t, chunk, chunk, E_FROM_SIZE_T,
|
||||||
std::size_t, total, total, E_FROM_SIZE_T,
|
std::size_t, total, total, E_FROM_SIZE_T,
|
||||||
std::size_t, complete, complete, E_FROM_SIZE_T,
|
std::size_t, complete, complete, E_FROM_SIZE_T,
|
||||||
@ -50,46 +50,46 @@ E_SIMPLE6(download_chunk_end, debug, true,
|
|||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(download_end, info, true,
|
E_SIMPLE3(download_end, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING,
|
std::string, dest_path, dest, E_FROM_STRING,
|
||||||
api_error, result, result, E_FROM_API_FILE_ERROR
|
api_error, result, result, E_FROM_API_FILE_ERROR
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(download_progress, info, true,
|
E_SIMPLE3(download_progress, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING,
|
std::string, dest_path, dest, E_FROM_STRING,
|
||||||
double, progress, prog, E_DOUBLE_PRECISE
|
double, progress, prog, E_FROM_DOUBLE_PRECISE
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(download_restored, info, true,
|
E_SIMPLE2(download_restored, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING
|
std::string, dest_path, dest, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(download_restore_failed, error, true,
|
E_SIMPLE3(download_restore_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING,
|
std::string, dest_path, dest, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE3(download_resume_add_failed, error, true,
|
E_SIMPLE3(download_resume_add_failed, error, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING,
|
std::string, dest_path, dest, E_FROM_STRING,
|
||||||
std::string, error, err, E_STRING
|
std::string, error, err, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(download_resume_added, info, true,
|
E_SIMPLE2(download_resume_added, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING
|
std::string, dest_path, dest, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE2(download_resume_removed, info, true,
|
E_SIMPLE2(download_resume_removed, info, true,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
std::string, dest_path, dest, E_STRING
|
std::string, dest_path, dest, E_FROM_STRING
|
||||||
);
|
);
|
||||||
|
|
||||||
E_SIMPLE1(item_timeout, debug, true,
|
E_SIMPLE1(item_timeout, debug, true,
|
||||||
std::string, api_path, ap, E_STRING
|
std::string, api_path, ap, E_FROM_STRING
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE2(packet_client_timeout, error, true,
|
E_SIMPLE2(packet_client_timeout, error, true,
|
||||||
std::string, event_name, en, E_STRING,
|
std::string, event_name, en, E_FROM_STRING,
|
||||||
std::string, message, msg, E_STRING
|
std::string, message, msg, E_FROM_STRING
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ namespace repertory::remote_fuse {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE3(remote_fuse_server_event, debug, true,
|
E_SIMPLE3(remote_fuse_server_event, debug, true,
|
||||||
std::string, function, func, E_STRING,
|
std::string, function, func, E_FROM_STRING,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
packet::error_type, result, res, E_FROM_INT32
|
packet::error_type, result, res, E_FROM_INT32
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -40,8 +40,8 @@ namespace repertory::remote_winfsp {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE3(remote_winfsp_client_event, debug, true,
|
E_SIMPLE3(remote_winfsp_client_event, debug, true,
|
||||||
std::string, function, func, E_STRING,
|
std::string, function, func, E_FROM_STRING,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
packet::error_type, result, res, E_FROM_INT32
|
packet::error_type, result, res, E_FROM_INT32
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -54,8 +54,8 @@ namespace repertory::remote_winfsp {
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE3(remote_winfsp_server_event, debug, true,
|
E_SIMPLE3(remote_winfsp_server_event, debug, true,
|
||||||
std::string, function, FUNC, E_STRING,
|
std::string, function, FUNC, E_FROM_STRING,
|
||||||
std::string, api_path, AP, E_STRING,
|
std::string, api_path, AP, E_FROM_STRING,
|
||||||
packet::error_type, result, RES, E_FROM_INT32
|
packet::error_type, result, RES, E_FROM_INT32
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -44,8 +44,8 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
E_SIMPLE3(winfsp_event, debug, true,
|
E_SIMPLE3(winfsp_event, debug, true,
|
||||||
std::string, function, func, E_STRING,
|
std::string, function, func, E_FROM_STRING,
|
||||||
std::string, api_path, ap, E_STRING,
|
std::string, api_path, ap, E_FROM_STRING,
|
||||||
NTSTATUS, result, res, E_FROM_INT32
|
NTSTATUS, result, res, E_FROM_INT32
|
||||||
);
|
);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@ -49,7 +49,7 @@ void launch_app(std::string cmd) {
|
|||||||
EXPECT_EQ(0, code);
|
EXPECT_EQ(0, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
E_SIMPLE1(test_begin, info, false, std::string, test_name, TN, E_STRING);
|
E_SIMPLE1(test_begin, info, false, std::string, test_name, TN, E_FROM_STRING);
|
||||||
#define TEST_HEADER(func) \
|
#define TEST_HEADER(func) \
|
||||||
event_system::instance().raise<test_begin>( \
|
event_system::instance().raise<test_begin>( \
|
||||||
std::string(func) + \
|
std::string(func) + \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user