From: Przemysław Adam Sowa Date: Mon, 30 May 2022 18:27:26 +0000 (+0200) Subject: Renamed Hihi to Unmarshaller and Hoho to Marshaller X-Git-Tag: v0.10.3~16^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4884df1310f87653f66924fcf2d392674f8cbdac;p=thirdparty%2Fsnapper.git Renamed Hihi to Unmarshaller and Hoho to Marshaller --- diff --git a/client/commands.cc b/client/commands.cc index bc0993a3..71e5fab0 100644 --- a/client/commands.cc +++ b/client/commands.cc @@ -47,8 +47,8 @@ command_list_xconfigs(DBus::Connection& conn) vector ret; - DBus::Hihi hihi(reply); - hihi >> ret; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> ret; return ret; } @@ -59,15 +59,15 @@ command_get_xconfig(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetConfig"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; DBus::Message reply = conn.send_with_reply_and_block(call); XConfigInfo ret; - DBus::Hihi hihi(reply); - hihi >> ret; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> ret; return ret; } @@ -79,8 +79,8 @@ command_set_xconfig(DBus::Connection& conn, const string& config_name, { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "SetConfig"); - DBus::Hoho hoho(call); - hoho << config_name << raw; + DBus::Marshaller marshaller(call); + marshaller << config_name << raw; conn.send_with_reply_and_block(call); } @@ -92,8 +92,8 @@ command_create_config(DBus::Connection& conn, const string& config_name, const s { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CreateConfig"); - DBus::Hoho hoho(call); - hoho << config_name << subvolume << fstype << template_name; + DBus::Marshaller marshaller(call); + marshaller << config_name << subvolume << fstype << template_name; conn.send_with_reply_and_block(call); } @@ -104,8 +104,8 @@ command_delete_config(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "DeleteConfig"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; conn.send_with_reply_and_block(call); } @@ -116,15 +116,15 @@ command_list_xsnapshots(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "ListSnapshots"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; DBus::Message reply = conn.send_with_reply_and_block(call); XSnapshots ret; - DBus::Hihi hihi(reply); - hihi >> ret.entries; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> ret.entries; return ret; } @@ -135,15 +135,15 @@ command_get_xsnapshot(DBus::Connection& conn, const string& config_name, unsigne { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name << num; + DBus::Marshaller marshaller(call); + marshaller << config_name << num; DBus::Message reply = conn.send_with_reply_and_block(call); XSnapshot ret; - DBus::Hihi hihi(reply); - hihi >> ret; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> ret; return ret; } @@ -155,8 +155,8 @@ command_set_snapshot(DBus::Connection& conn, const string& config_name, unsigned { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "SetSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name << num << smd.description << smd.cleanup << smd.userdata; + DBus::Marshaller marshaller(call); + marshaller << config_name << num << smd.description << smd.cleanup << smd.userdata; conn.send_with_reply_and_block(call); } @@ -169,15 +169,15 @@ command_create_single_snapshot(DBus::Connection& conn, const string& config_name { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CreateSingleSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name << description << cleanup << userdata; + DBus::Marshaller marshaller(call); + marshaller << config_name << description << cleanup << userdata; DBus::Message reply = conn.send_with_reply_and_block(call); unsigned int number; - DBus::Hihi hihi(reply); - hihi >> number; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> number; return number; } @@ -191,15 +191,15 @@ command_create_single_snapshot_v2(DBus::Connection& conn, const string& config_n { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CreateSingleSnapshotV2"); - DBus::Hoho hoho(call); - hoho << config_name << parent_num << read_only << description << cleanup << userdata; + DBus::Marshaller marshaller(call); + marshaller << config_name << parent_num << read_only << description << cleanup << userdata; DBus::Message reply = conn.send_with_reply_and_block(call); unsigned int number; - DBus::Hihi hihi(reply); - hihi >> number; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> number; return number; } @@ -213,15 +213,15 @@ command_create_single_snapshot_of_default(DBus::Connection& conn, const string& { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CreateSingleSnapshotOfDefault"); - DBus::Hoho hoho(call); - hoho << config_name << read_only << description << cleanup << userdata; + DBus::Marshaller marshaller(call); + marshaller << config_name << read_only << description << cleanup << userdata; DBus::Message reply = conn.send_with_reply_and_block(call); unsigned int number; - DBus::Hihi hihi(reply); - hihi >> number; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> number; return number; } @@ -234,15 +234,15 @@ command_create_pre_snapshot(DBus::Connection& conn, const string& config_name, { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CreatePreSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name << description << cleanup << userdata; + DBus::Marshaller marshaller(call); + marshaller << config_name << description << cleanup << userdata; DBus::Message reply = conn.send_with_reply_and_block(call); unsigned int number; - DBus::Hihi hihi(reply); - hihi >> number; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> number; return number; } @@ -255,15 +255,15 @@ command_create_post_snapshot(DBus::Connection& conn, const string& config_name, { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CreatePostSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name << prenum << description << cleanup << userdata; + DBus::Marshaller marshaller(call); + marshaller << config_name << prenum << description << cleanup << userdata; DBus::Message reply = conn.send_with_reply_and_block(call); unsigned int number; - DBus::Hihi hihi(reply); - hihi >> number; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> number; return number; } @@ -289,8 +289,8 @@ command_delete_snapshots(DBus::Connection& conn, const string& config_name, DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "DeleteSnapshots"); - DBus::Hoho hoho(call); - hoho << config_name << nums; + DBus::Marshaller marshaller(call); + marshaller << config_name << nums; conn.send_with_reply_and_block(call); } @@ -303,16 +303,16 @@ command_get_default_snapshot(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetDefaultSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; DBus::Message reply = conn.send_with_reply_and_block(call); bool valid; unsigned int number; - DBus::Hihi hihi(reply); - hihi >> valid >> number; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> valid >> number; return make_pair(valid, number); } @@ -330,16 +330,16 @@ command_get_active_snapshot(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetActiveSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; DBus::Message reply = conn.send_with_reply_and_block(call); bool valid; unsigned int number; - DBus::Hihi hihi(reply); - hihi >> valid >> number; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> valid >> number; return make_pair(valid, number); } @@ -357,8 +357,8 @@ command_calculate_used_space(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CalculateUsedSpace"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; conn.send_with_reply_and_block(call); } @@ -374,15 +374,15 @@ command_get_used_space(DBus::Connection& conn, const string& config_name, unsign { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetUsedSpace"); - DBus::Hoho hoho(call); - hoho << config_name << num; + DBus::Marshaller marshaller(call); + marshaller << config_name << num; DBus::Message reply = conn.send_with_reply_and_block(call); uint64_t used_space; - DBus::Hihi hihi(reply); - hihi >> used_space; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> used_space; return used_space; } @@ -394,15 +394,15 @@ command_mount_snapshot(DBus::Connection& conn, const string& config_name, { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "MountSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name << num << user_request; + DBus::Marshaller marshaller(call); + marshaller << config_name << num << user_request; DBus::Message reply = conn.send_with_reply_and_block(call); string mount_point; - DBus::Hihi hihi(reply); - hihi >> mount_point; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> mount_point; return mount_point; } @@ -414,8 +414,8 @@ command_umount_snapshot(DBus::Connection& conn, const string& config_name, unsig { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "UmountSnapshot"); - DBus::Hoho hoho(call); - hoho << config_name << num << user_request; + DBus::Marshaller marshaller(call); + marshaller << config_name << num << user_request; conn.send_with_reply_and_block(call); } @@ -426,15 +426,15 @@ command_get_mount_point(DBus::Connection& conn, const string& config_name, unsig { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetMountPoint"); - DBus::Hoho hoho(call); - hoho << config_name << num; + DBus::Marshaller marshaller(call); + marshaller << config_name << num; DBus::Message reply = conn.send_with_reply_and_block(call); string mount_point; - DBus::Hihi hihi(reply); - hihi >> mount_point; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> mount_point; return mount_point; } @@ -446,8 +446,8 @@ command_create_comparison(DBus::Connection& conn, const string& config_name, uns { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "CreateComparison"); - DBus::Hoho hoho(call); - hoho << config_name << number1 << number2; + DBus::Marshaller marshaller(call); + marshaller << config_name << number1 << number2; conn.send_with_reply_and_block(call); } @@ -459,8 +459,8 @@ command_delete_comparison(DBus::Connection& conn, const string& config_name, uns { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "DeleteComparison"); - DBus::Hoho hoho(call); - hoho << config_name << number1 << number2; + DBus::Marshaller marshaller(call); + marshaller << config_name << number1 << number2; conn.send_with_reply_and_block(call); } @@ -472,15 +472,15 @@ command_get_xfiles(DBus::Connection& conn, const string& config_name, unsigned i { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetFiles"); - DBus::Hoho hoho(call); - hoho << config_name << number1 << number2; + DBus::Marshaller marshaller(call); + marshaller << config_name << number1 << number2; DBus::Message reply = conn.send_with_reply_and_block(call); vector files; - DBus::Hihi hihi(reply); - hihi >> files; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> files; return files; } @@ -492,15 +492,15 @@ command_get_xfiles_by_pipe(DBus::Connection& conn, const string& config_name, un { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "GetFilesByPipe"); - DBus::Hoho hoho(call); - hoho << config_name << number1 << number2; + DBus::Marshaller marshaller(call); + marshaller << config_name << number1 << number2; DBus::Message reply = conn.send_with_reply_and_block(call); DBus::FileDescriptor fd; - DBus::Hihi hihi(reply); - hihi >> fd; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> fd; vector files; @@ -554,8 +554,8 @@ command_setup_quota(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "SetupQuota"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; conn.send_with_reply_and_block(call); } @@ -568,8 +568,8 @@ command_prepare_quota(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "PrepareQuota"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; conn.send_with_reply_and_block(call); } @@ -587,15 +587,15 @@ command_query_quota(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "QueryQuota"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; DBus::Message reply = conn.send_with_reply_and_block(call); QuotaData quota_data; - DBus::Hihi hihi(reply); - hihi >> quota_data; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> quota_data; return quota_data; } @@ -613,15 +613,15 @@ command_query_free_space(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "QueryFreeSpace"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; DBus::Message reply = conn.send_with_reply_and_block(call); FreeSpaceData free_space_data; - DBus::Hihi hihi(reply); - hihi >> free_space_data; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> free_space_data; return free_space_data; } @@ -637,8 +637,8 @@ command_sync(DBus::Connection& conn, const string& config_name) { DBus::MessageMethodCall call(SERVICE, OBJECT, INTERFACE, "Sync"); - DBus::Hoho hoho(call); - hoho << config_name; + DBus::Marshaller marshaller(call); + marshaller << config_name; conn.send_with_reply_and_block(call); } @@ -653,8 +653,8 @@ command_debug(DBus::Connection& conn) vector lines; - DBus::Hihi hihi(reply); - hihi >> lines; + DBus::Unmarshaller unmarshaller(reply); + unmarshaller >> lines; return lines; } diff --git a/client/types.cc b/client/types.cc index 1196beb6..e1c00f10 100644 --- a/client/types.cc +++ b/client/types.cc @@ -34,72 +34,72 @@ namespace DBus const char* TypeInfo::signature = "(su)"; - Hihi& - operator>>(Hihi& hihi, XConfigInfo& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, XConfigInfo& data) { - hihi.open_recurse(); - hihi >> data.config_name >> data.subvolume >> data.raw; - hihi.close_recurse(); - return hihi; + unmarshaller.open_recurse(); + unmarshaller >> data.config_name >> data.subvolume >> data.raw; + unmarshaller.close_recurse(); + return unmarshaller; } - Hihi& - operator>>(Hihi& hihi, SnapshotType& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, SnapshotType& data) { dbus_uint16_t tmp; - hihi >> tmp; + unmarshaller >> tmp; data = static_cast(tmp); - return hihi; + return unmarshaller; } - Hihi& - operator>>(Hihi& hihi, XSnapshot& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, XSnapshot& data) { - hihi.open_recurse(); - hihi >> data.num >> data.type >> data.pre_num >> data.date >> data.uid >> data.description + unmarshaller.open_recurse(); + unmarshaller >> data.num >> data.type >> data.pre_num >> data.date >> data.uid >> data.description >> data.cleanup >> data.userdata; - hihi.close_recurse(); - return hihi; + unmarshaller.close_recurse(); + return unmarshaller; } - Hihi& - operator>>(Hihi& hihi, XFile& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, XFile& data) { - hihi.open_recurse(); - hihi >> data.name >> data.status; - hihi.close_recurse(); - return hihi; + unmarshaller.open_recurse(); + unmarshaller >> data.name >> data.status; + unmarshaller.close_recurse(); + return unmarshaller; } - Hihi& - operator>>(Hihi& hihi, QuotaData& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, QuotaData& data) { - hihi.open_recurse(); - hihi >> data.size >> data.used; - hihi.close_recurse(); - return hihi; + unmarshaller.open_recurse(); + unmarshaller >> data.size >> data.used; + unmarshaller.close_recurse(); + return unmarshaller; } - Hihi& - operator>>(Hihi& hihi, FreeSpaceData& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, FreeSpaceData& data) { - hihi.open_recurse(); - hihi >> data.size >> data.free; - hihi.close_recurse(); - return hihi; + unmarshaller.open_recurse(); + unmarshaller >> data.size >> data.free; + unmarshaller.close_recurse(); + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, SnapshotType data) + Marshaller& + operator<<(Marshaller& marshaller, SnapshotType data) { - hoho << static_cast(data); - return hoho; + marshaller << static_cast(data); + return marshaller; } } diff --git a/client/types.h b/client/types.h index 9217eacd..fa808895 100644 --- a/client/types.h +++ b/client/types.h @@ -102,17 +102,17 @@ namespace DBus template <> struct TypeInfo { static const char* signature; }; template <> struct TypeInfo { static const char* signature; }; - Hihi& operator>>(Hihi& hihi, XConfigInfo& data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, XConfigInfo& data); - Hihi& operator>>(Hihi& hihi, SnapshotType& data); - Hoho& operator<<(Hoho& hoho, SnapshotType data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, SnapshotType& data); + Marshaller& operator<<(Marshaller& marshaller, SnapshotType data); - Hihi& operator>>(Hihi& hihi, XSnapshot& data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, XSnapshot& data); - Hihi& operator>>(Hihi& hihi, XFile& data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, XFile& data); - Hihi& operator>>(Hihi& hihi, QuotaData& data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, QuotaData& data); - Hihi& operator>>(Hihi& hihi, FreeSpaceData& data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, FreeSpaceData& data); } diff --git a/dbus/DBusMainLoop.cc b/dbus/DBusMainLoop.cc index 67d4f0b7..041326de 100644 --- a/dbus/DBusMainLoop.cc +++ b/dbus/DBusMainLoop.cc @@ -334,8 +334,8 @@ namespace DBus { string name, old_owner, new_owner; - DBus::Hihi hihi(msg); - hihi >> name >> old_owner >> new_owner; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> name >> old_owner >> new_owner; if (name == old_owner && new_owner.empty()) client_disconnected(name); diff --git a/dbus/DBusMessage.cc b/dbus/DBusMessage.cc index 0d1d8859..209e4413 100644 --- a/dbus/DBusMessage.cc +++ b/dbus/DBusMessage.cc @@ -70,7 +70,7 @@ namespace DBus const char* TypeInfo::signature = "s"; - Hihi::Hihi(Message& msg) + Unmarshaller::Unmarshaller(Message& msg) { iters.push_back(new DBusMessageIter()); if (!dbus_message_iter_init(msg.get_message(), top())) @@ -78,7 +78,7 @@ namespace DBus } - Hihi::~Hihi() + Unmarshaller::~Unmarshaller() { delete iters.back(); iters.pop_back(); @@ -87,7 +87,7 @@ namespace DBus void - Hihi::open_recurse() + Unmarshaller::open_recurse() { DBusMessageIter* iter2 = new DBusMessageIter(); dbus_message_iter_recurse(top(), iter2); @@ -96,7 +96,7 @@ namespace DBus void - Hihi::close_recurse() + Unmarshaller::close_recurse() { delete iters.back(); iters.pop_back(); @@ -104,14 +104,14 @@ namespace DBus } - Hoho::Hoho(Message& msg) + Marshaller::Marshaller(Message& msg) { iters.push_back(new DBusMessageIter()); dbus_message_iter_init_append(msg.get_message(), top()); } - Hoho::~Hoho() + Marshaller::~Marshaller() { delete iters.back(); iters.pop_back(); @@ -119,7 +119,7 @@ namespace DBus } void - Hoho::open_struct() + Marshaller::open_struct() { DBusMessageIter* iter2 = new DBusMessageIter(); if (!dbus_message_iter_open_container(top(), DBUS_TYPE_STRUCT, NULL, iter2)) @@ -129,7 +129,7 @@ namespace DBus void - Hoho::close_struct() + Marshaller::close_struct() { DBusMessageIter* iter2 = top(); iters.pop_back(); @@ -140,7 +140,7 @@ namespace DBus void - Hoho::open_array(const char* signature) + Marshaller::open_array(const char* signature) { DBusMessageIter* iter2 = new DBusMessageIter(); if (!dbus_message_iter_open_container(top(), DBUS_TYPE_ARRAY, signature, iter2)) @@ -150,7 +150,7 @@ namespace DBus void - Hoho::close_array() + Marshaller::close_array() { DBusMessageIter* iter2 = top(); iters.pop_back(); @@ -161,7 +161,7 @@ namespace DBus void - Hoho::open_dict_entry() + Marshaller::open_dict_entry() { DBusMessageIter* iter2 = new DBusMessageIter(); if (!dbus_message_iter_open_container(top(), DBUS_TYPE_DICT_ENTRY, 0, iter2)) @@ -171,7 +171,7 @@ namespace DBus void - Hoho::close_dict_entry() + Marshaller::close_dict_entry() { DBusMessageIter* iter2 = top(); iters.pop_back(); @@ -181,139 +181,139 @@ namespace DBus } - Hihi& - operator>>(Hihi& hihi, bool& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, bool& data) { - if (hihi.get_type() != DBUS_TYPE_BOOLEAN) + if (unmarshaller.get_type() != DBUS_TYPE_BOOLEAN) throw MarshallingException(); dbus_bool_t tmp; - dbus_message_iter_get_basic(hihi.top(), &tmp); - dbus_message_iter_next(hihi.top()); + dbus_message_iter_get_basic(unmarshaller.top(), &tmp); + dbus_message_iter_next(unmarshaller.top()); data = tmp; - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, bool data) + Marshaller& + operator<<(Marshaller& marshaller, bool data) { dbus_bool_t tmp = data; - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_BOOLEAN, &tmp)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_BOOLEAN, &tmp)) throw FatalException(); - return hoho; + return marshaller; } - Hihi& - operator>>(Hihi& hihi, dbus_uint16_t& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, dbus_uint16_t& data) { - if (hihi.get_type() != DBUS_TYPE_UINT16) + if (unmarshaller.get_type() != DBUS_TYPE_UINT16) throw MarshallingException(); - dbus_message_iter_get_basic(hihi.top(), &data); - dbus_message_iter_next(hihi.top()); + dbus_message_iter_get_basic(unmarshaller.top(), &data); + dbus_message_iter_next(unmarshaller.top()); - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, dbus_uint16_t data) + Marshaller& + operator<<(Marshaller& marshaller, dbus_uint16_t data) { - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_UINT16, &data)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UINT16, &data)) throw FatalException(); - return hoho; + return marshaller; } - Hihi& - operator>>(Hihi& hihi, dbus_uint32_t& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, dbus_uint32_t& data) { - if (hihi.get_type() != DBUS_TYPE_UINT32) + if (unmarshaller.get_type() != DBUS_TYPE_UINT32) throw MarshallingException(); - dbus_message_iter_get_basic(hihi.top(), &data); - dbus_message_iter_next(hihi.top()); + dbus_message_iter_get_basic(unmarshaller.top(), &data); + dbus_message_iter_next(unmarshaller.top()); - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, dbus_uint32_t data) + Marshaller& + operator<<(Marshaller& marshaller, dbus_uint32_t data) { - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_UINT32, &data)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UINT32, &data)) throw FatalException(); - return hoho; + return marshaller; } - Hihi& - operator>>(Hihi& hihi, dbus_uint64_t& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, dbus_uint64_t& data) { - if (hihi.get_type() != DBUS_TYPE_UINT64) + if (unmarshaller.get_type() != DBUS_TYPE_UINT64) throw MarshallingException(); - dbus_message_iter_get_basic(hihi.top(), &data); - dbus_message_iter_next(hihi.top()); + dbus_message_iter_get_basic(unmarshaller.top(), &data); + dbus_message_iter_next(unmarshaller.top()); - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, dbus_uint64_t data) + Marshaller& + operator<<(Marshaller& marshaller, dbus_uint64_t data) { - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_UINT64, &data)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UINT64, &data)) throw FatalException(); - return hoho; + return marshaller; } - Hihi& - operator>>(Hihi& hihi, time_t& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, time_t& data) { - if (hihi.get_type() != DBUS_TYPE_INT64) + if (unmarshaller.get_type() != DBUS_TYPE_INT64) throw MarshallingException(); dbus_uint64_t tmp; - dbus_message_iter_get_basic(hihi.top(), &tmp); - dbus_message_iter_next(hihi.top()); + dbus_message_iter_get_basic(unmarshaller.top(), &tmp); + dbus_message_iter_next(unmarshaller.top()); data = tmp; - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, time_t data) + Marshaller& + operator<<(Marshaller& marshaller, time_t data) { dbus_uint64_t tmp = data; - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_INT64, &tmp)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_INT64, &tmp)) throw FatalException(); - return hoho; + return marshaller; } - Hoho& - operator<<(Hoho& hoho, const char* data) + Marshaller& + operator<<(Marshaller& marshaller, const char* data) { - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_STRING, &data)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_STRING, &data)) throw FatalException(); - return hoho; + return marshaller; } string - Hihi::unescape(const string& in) + Unmarshaller::unescape(const string& in) { string out; @@ -357,23 +357,23 @@ namespace DBus } - Hihi& - operator>>(Hihi& hihi, string& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, string& data) { - if (hihi.get_type() != DBUS_TYPE_STRING) + if (unmarshaller.get_type() != DBUS_TYPE_STRING) throw MarshallingException(); const char* p = NULL; - dbus_message_iter_get_basic(hihi.top(), &p); - dbus_message_iter_next(hihi.top()); - data = hihi.unescape(p); + dbus_message_iter_get_basic(unmarshaller.top(), &p); + dbus_message_iter_next(unmarshaller.top()); + data = unmarshaller.unescape(p); - return hihi; + return unmarshaller; } string - Hoho::escape(const string& in) + Marshaller::escape(const string& in) { string out; @@ -399,63 +399,63 @@ namespace DBus } - Hoho& - operator<<(Hoho& hoho, const string& data) + Marshaller& + operator<<(Marshaller& marshaller, const string& data) { - string tmp = hoho.escape(data); + string tmp = marshaller.escape(data); const char* p = tmp.c_str(); - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_STRING, &p)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_STRING, &p)) throw FatalException(); - return hoho; + return marshaller; } - Hihi& - operator>>(Hihi& hihi, map& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, map& data) { - if (hihi.get_type() != DBUS_TYPE_ARRAY) + if (unmarshaller.get_type() != DBUS_TYPE_ARRAY) throw MarshallingException(); - hihi.open_recurse(); + unmarshaller.open_recurse(); - while (hihi.get_type() != DBUS_TYPE_INVALID) + while (unmarshaller.get_type() != DBUS_TYPE_INVALID) { - if (hihi.get_signature() != "{ss}") + if (unmarshaller.get_signature() != "{ss}") throw MarshallingException(); - hihi.open_recurse(); + unmarshaller.open_recurse(); string k, v; - hihi >> k >> v; + unmarshaller >> k >> v; data[k] = v; - hihi.close_recurse(); + unmarshaller.close_recurse(); } - hihi.close_recurse(); + unmarshaller.close_recurse(); - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, const map& data) + Marshaller& + operator<<(Marshaller& marshaller, const map& data) { - hoho.open_array("{ss}"); + marshaller.open_array("{ss}"); for (map::const_iterator it = data.begin(); it != data.end() ; ++it) { - hoho.open_dict_entry(); + marshaller.open_dict_entry(); - hoho << it->first << it->second; + marshaller << it->first << it->second; - hoho.close_dict_entry(); + marshaller.close_dict_entry(); } - hoho.close_array(); + marshaller.close_array(); - return hoho; + return marshaller; } } diff --git a/dbus/DBusMessage.h b/dbus/DBusMessage.h index 09190d05..97ff5648 100644 --- a/dbus/DBusMessage.h +++ b/dbus/DBusMessage.h @@ -186,13 +186,13 @@ namespace DBus }; - class Hihi : public Marshalling + class Unmarshaller : public Marshalling { public: - Hihi(Message& msg); - ~Hihi(); + Unmarshaller(Message& msg); + ~Unmarshaller(); void open_recurse(); void close_recurse(); @@ -202,13 +202,13 @@ namespace DBus }; - class Hoho : public Marshalling + class Marshaller : public Marshalling { public: - Hoho(Message& msg); - ~Hoho(); + Marshaller(Message& msg); + ~Marshaller(); void open_struct(); void close_struct(); @@ -224,107 +224,107 @@ namespace DBus }; - Hihi& operator>>(Hihi& hihi, bool& data); - Hoho& operator<<(Hoho& hoho, bool data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, bool& data); + Marshaller& operator<<(Marshaller& marshaller, bool data); - Hihi& operator>>(Hihi& hihi, dbus_uint16_t& data); - Hoho& operator<<(Hoho& hoho, dbus_uint16_t data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, dbus_uint16_t& data); + Marshaller& operator<<(Marshaller& marshaller, dbus_uint16_t data); - Hihi& operator>>(Hihi& hihi, dbus_uint32_t& data); - Hoho& operator<<(Hoho& hoho, dbus_uint32_t data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, dbus_uint32_t& data); + Marshaller& operator<<(Marshaller& marshaller, dbus_uint32_t data); - Hihi& operator>>(Hihi& hihi, dbus_uint64_t& data); - Hoho& operator<<(Hoho& hoho, dbus_uint64_t data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, dbus_uint64_t& data); + Marshaller& operator<<(Marshaller& marshaller, dbus_uint64_t data); - Hihi& operator>>(Hihi& hihi, time_t& data); - Hoho& operator<<(Hoho& hoho, time_t data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, time_t& data); + Marshaller& operator<<(Marshaller& marshaller, time_t data); - Hoho& operator<<(Hoho& hoho, const char* data); + Marshaller& operator<<(Marshaller& marshaller, const char* data); - Hihi& operator>>(Hihi& hihi, string& data); - Hoho& operator<<(Hoho& hoho, const string& data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, string& data); + Marshaller& operator<<(Marshaller& marshaller, const string& data); - Hihi& operator>>(Hihi& hihi, map& data); - Hoho& operator<<(Hoho& hoho, const map& data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, map& data); + Marshaller& operator<<(Marshaller& marshaller, const map& data); template - Hihi& operator>>(Hihi& hihi, vector& data) + Unmarshaller& operator>>(Unmarshaller& unmarshaller, vector& data) { - if (hihi.get_type() != DBUS_TYPE_ARRAY) + if (unmarshaller.get_type() != DBUS_TYPE_ARRAY) throw MarshallingException(); - hihi.open_recurse(); + unmarshaller.open_recurse(); - while (hihi.get_type() != DBUS_TYPE_INVALID) + while (unmarshaller.get_type() != DBUS_TYPE_INVALID) { - if (hihi.get_signature() != TypeInfo::signature) + if (unmarshaller.get_signature() != TypeInfo::signature) throw MarshallingException(); Type tmp; - hihi >> tmp; + unmarshaller >> tmp; data.push_back(tmp); } - hihi.close_recurse(); + unmarshaller.close_recurse(); - return hihi; + return unmarshaller; } template - Hoho& operator<<(Hoho& hoho, const vector& data) + Marshaller& operator<<(Marshaller& marshaller, const vector& data) { - hoho.open_array(TypeInfo::signature); + marshaller.open_array(TypeInfo::signature); for (typename vector::const_iterator it = data.begin(); it != data.end(); ++it) { - hoho << *it; + marshaller << *it; } - hoho.close_array(); + marshaller.close_array(); - return hoho; + return marshaller; } template - Hihi& operator>>(Hihi& hihi, list& data) + Unmarshaller& operator>>(Unmarshaller& unmarshaller, list& data) { - if (hihi.get_type() != DBUS_TYPE_ARRAY) + if (unmarshaller.get_type() != DBUS_TYPE_ARRAY) throw MarshallingException(); - hihi.open_recurse(); + unmarshaller.open_recurse(); - while (hihi.get_type() != DBUS_TYPE_INVALID) + while (unmarshaller.get_type() != DBUS_TYPE_INVALID) { - if (hihi.get_signature() != TypeInfo::signature) + if (unmarshaller.get_signature() != TypeInfo::signature) throw MarshallingException(); Type tmp; - hihi >> tmp; + unmarshaller >> tmp; data.push_back(tmp); } - hihi.close_recurse(); + unmarshaller.close_recurse(); - return hihi; + return unmarshaller; } template - Hoho& operator<<(Hoho& hoho, const list& data) + Marshaller& operator<<(Marshaller& marshaller, const list& data) { - hoho.open_array(TypeInfo::signature); + marshaller.open_array(TypeInfo::signature); for (typename list::const_iterator it = data.begin(); it != data.end(); ++it) { - hoho << *it; + marshaller << *it; } - hoho.close_array(); + marshaller.close_array(); - return hoho; + return marshaller; } } diff --git a/dbus/DBusPipe.cc b/dbus/DBusPipe.cc index b332062e..ad41498e 100644 --- a/dbus/DBusPipe.cc +++ b/dbus/DBusPipe.cc @@ -40,29 +40,29 @@ namespace DBus } - Hihi& - operator>>(Hihi& hihi, FileDescriptor& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, FileDescriptor& data) { - if (hihi.get_type() != DBUS_TYPE_UNIX_FD) + if (unmarshaller.get_type() != DBUS_TYPE_UNIX_FD) throw MarshallingException(); int fd; - dbus_message_iter_get_basic(hihi.top(), &fd); - dbus_message_iter_next(hihi.top()); + dbus_message_iter_get_basic(unmarshaller.top(), &fd); + dbus_message_iter_next(unmarshaller.top()); data.set_fd(fd); - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, const FileDescriptor& data) + Marshaller& + operator<<(Marshaller& marshaller, const FileDescriptor& data) { const int fd = data.get_fd(); - if (!dbus_message_iter_append_basic(hoho.top(), DBUS_TYPE_UNIX_FD, &fd)) + if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UNIX_FD, &fd)) throw FatalException(); - return hoho; + return marshaller; } @@ -108,7 +108,7 @@ namespace DBus string Pipe::unescape(const string& in) { - return Hihi::unescape(in); + return Unmarshaller::unescape(in); } } diff --git a/dbus/DBusPipe.h b/dbus/DBusPipe.h index 8d91fac0..b5b181c6 100644 --- a/dbus/DBusPipe.h +++ b/dbus/DBusPipe.h @@ -51,8 +51,8 @@ namespace DBus }; - Hihi& operator>>(Hihi& hoho, FileDescriptor& data); - Hoho& operator<<(Hoho& hoho, const FileDescriptor& data); + Unmarshaller& operator>>(Unmarshaller& marshaller, FileDescriptor& data); + Marshaller& operator<<(Marshaller& marshaller, const FileDescriptor& data); struct PipeException : public Exception diff --git a/server/Client.cc b/server/Client.cc index e8a87858..53b3747f 100644 --- a/server/Client.cc +++ b/server/Client.cc @@ -390,8 +390,8 @@ Client::introspect(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << introspect; + DBus::Marshaller marshaller(reply); + marshaller << introspect; conn.send(reply); } @@ -507,8 +507,8 @@ Client::signal_config_created(DBus::Connection& conn, const string& config_name) { DBus::MessageSignal msg(PATH, INTERFACE, "ConfigCreated"); - DBus::Hoho hoho(msg); - hoho << config_name; + DBus::Marshaller marshaller(msg); + marshaller << config_name; conn.send(msg); } @@ -519,8 +519,8 @@ Client::signal_config_modified(DBus::Connection& conn, const string& config_name { DBus::MessageSignal msg(PATH, INTERFACE, "ConfigModified"); - DBus::Hoho hoho(msg); - hoho << config_name; + DBus::Marshaller marshaller(msg); + marshaller << config_name; conn.send(msg); } @@ -531,8 +531,8 @@ Client::signal_config_deleted(DBus::Connection& conn, const string& config_name) { DBus::MessageSignal msg(PATH, INTERFACE, "ConfigDeleted"); - DBus::Hoho hoho(msg); - hoho << config_name; + DBus::Marshaller marshaller(msg); + marshaller << config_name; conn.send(msg); } @@ -544,8 +544,8 @@ Client::signal_snapshot_created(DBus::Connection& conn, const string& config_nam { DBus::MessageSignal msg(PATH, INTERFACE, "SnapshotCreated"); - DBus::Hoho hoho(msg); - hoho << config_name << num; + DBus::Marshaller marshaller(msg); + marshaller << config_name << num; conn.send(msg); } @@ -557,8 +557,8 @@ Client::signal_snapshot_modified(DBus::Connection& conn, const string& config_na { DBus::MessageSignal msg(PATH, INTERFACE, "SnapshotModified"); - DBus::Hoho hoho(msg); - hoho << config_name << num; + DBus::Marshaller marshaller(msg); + marshaller << config_name << num; conn.send(msg); } @@ -570,8 +570,8 @@ Client::signal_snapshots_deleted(DBus::Connection& conn, const string& config_na { DBus::MessageSignal msg(PATH, INTERFACE, "SnapshotsDeleted"); - DBus::Hoho hoho(msg); - hoho << config_name << nums; + DBus::Marshaller marshaller(msg); + marshaller << config_name << nums; conn.send(msg); } @@ -586,11 +586,11 @@ Client::list_configs(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho.open_array(DBus::TypeInfo::signature); + DBus::Marshaller marshaller(reply); + marshaller.open_array(DBus::TypeInfo::signature); for (MetaSnappers::const_iterator it = meta_snappers.begin(); it != meta_snappers.end(); ++it) - hoho << it->getConfigInfo(); - hoho.close_array(); + marshaller << it->getConfigInfo(); + marshaller.close_array(); conn.send(reply); } @@ -601,8 +601,8 @@ Client::get_config(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("GetConfig config_name:" << config_name); @@ -614,8 +614,8 @@ Client::get_config(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << it->getConfigInfo(); + DBus::Marshaller marshaller(reply); + marshaller << it->getConfigInfo(); conn.send(reply); } @@ -626,9 +626,9 @@ Client::set_config(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); + DBus::Unmarshaller unmarshaller(msg); map raw; - hihi >> config_name >> raw; + unmarshaller >> config_name >> raw; y2deb("SetConfig config_name:" << config_name << " raw:" << raw); @@ -656,8 +656,8 @@ Client::create_config(DBus::Connection& conn, DBus::Message& msg) string fstype; string template_name; - DBus::Hihi hihi(msg); - hihi >> config_name >> subvolume >> fstype >> template_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> subvolume >> fstype >> template_name; y2deb("CreateConfig config_name:" << config_name << " subvolume:" << subvolume << " fstype:" << fstype << " template_name:" << template_name); @@ -681,8 +681,8 @@ Client::delete_config(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("DeleteConfig config_name:" << config_name); @@ -709,8 +709,8 @@ Client::lock_config(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("LockConfig config_name:" << config_name); @@ -733,8 +733,8 @@ Client::unlock_config(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("UnlockConfig config_name:" << config_name); @@ -757,8 +757,8 @@ Client::list_snapshots(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("ListSnapshots config_name:" << config_name); @@ -773,8 +773,8 @@ Client::list_snapshots(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << snapshots; + DBus::Marshaller marshaller(reply); + marshaller << snapshots; conn.send(reply); } @@ -786,8 +786,8 @@ Client::list_snapshots_at_time(DBus::Connection& conn, DBus::Message& msg) string config_name; time_t begin, end; - DBus::Hihi hihi(msg); - hihi >> config_name >> begin >> end; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> begin >> end; y2deb("ListSnapshotsAtTime config_name:" << config_name << " begin:" << begin << " end:" << end); @@ -803,15 +803,15 @@ Client::list_snapshots_at_time(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); + DBus::Marshaller marshaller(reply); - hoho.open_array(DBus::TypeInfo::signature); + marshaller.open_array(DBus::TypeInfo::signature); for (Snapshots::const_iterator it = snapshots.begin(); it != snapshots.end(); ++it) { if (it->getDate() >= begin && it->getDate() <= end) - hoho << *it; + marshaller << *it; } - hoho.close_array(); + marshaller.close_array(); conn.send(reply); } @@ -823,8 +823,8 @@ Client::get_snapshot(DBus::Connection& conn, DBus::Message& msg) string config_name; dbus_uint32_t num; - DBus::Hihi hihi(msg); - hihi >> config_name >> num; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num; y2deb("GetSnapshot config_name:" << config_name << " num:" << num); @@ -843,8 +843,8 @@ Client::get_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << *snap; + DBus::Marshaller marshaller(reply); + marshaller << *snap; conn.send(reply); } @@ -857,8 +857,8 @@ Client::set_snapshot(DBus::Connection& conn, DBus::Message& msg) dbus_uint32_t num; SMD smd; - DBus::Hihi hihi(msg); - hihi >> config_name >> num >> smd.description >> smd.cleanup >> smd.userdata; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num >> smd.description >> smd.cleanup >> smd.userdata; y2deb("SetSnapshot config_name:" << config_name << " num:" << num); @@ -891,8 +891,8 @@ Client::create_single_snapshot(DBus::Connection& conn, DBus::Message& msg) string config_name; SCD scd; - DBus::Hihi hihi(msg); - hihi >> config_name >> scd.description >> scd.cleanup >> scd.userdata; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> scd.description >> scd.cleanup >> scd.userdata; y2deb("CreateSingleSnapshot config_name:" << config_name << " description:" << scd.description << " cleanup:" << scd.cleanup); @@ -910,8 +910,8 @@ Client::create_single_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << snap1->getNum(); + DBus::Marshaller marshaller(reply); + marshaller << snap1->getNum(); conn.send(reply); @@ -926,8 +926,8 @@ Client::create_single_snapshot_v2(DBus::Connection& conn, DBus::Message& msg) unsigned int parent_num; SCD scd; - DBus::Hihi hihi(msg); - hihi >> config_name >> parent_num >> scd.read_only >> scd.description >> scd.cleanup >> scd.userdata; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> parent_num >> scd.read_only >> scd.description >> scd.cleanup >> scd.userdata; y2deb("CreateSingleSnapshotV2 config_name:" << config_name << " parent_num:" << parent_num << " read_only:" << scd.read_only << " description:" << scd.description << " cleanup:" << scd.cleanup); @@ -949,8 +949,8 @@ Client::create_single_snapshot_v2(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << snap2->getNum(); + DBus::Marshaller marshaller(reply); + marshaller << snap2->getNum(); conn.send(reply); @@ -964,8 +964,8 @@ Client::create_single_snapshot_of_default(DBus::Connection& conn, DBus::Message& string config_name; SCD scd; - DBus::Hihi hihi(msg); - hihi >> config_name >> scd.read_only >> scd.description >> scd.cleanup >> scd.userdata; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> scd.read_only >> scd.description >> scd.cleanup >> scd.userdata; y2deb("CreateSingleSnapshotOfDefault config_name:" << config_name << " read_only:" << scd.read_only << " description:" << scd.description << " cleanup:" << scd.cleanup); @@ -983,8 +983,8 @@ Client::create_single_snapshot_of_default(DBus::Connection& conn, DBus::Message& DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << snap->getNum(); + DBus::Marshaller marshaller(reply); + marshaller << snap->getNum(); conn.send(reply); @@ -998,8 +998,8 @@ Client::create_pre_snapshot(DBus::Connection& conn, DBus::Message& msg) string config_name; SCD scd; - DBus::Hihi hihi(msg); - hihi >> config_name >> scd.description >> scd.cleanup >> scd.userdata; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> scd.description >> scd.cleanup >> scd.userdata; y2deb("CreatePreSnapshot config_name:" << config_name << " description:" << scd.description << " cleanup:" << scd.cleanup); @@ -1017,8 +1017,8 @@ Client::create_pre_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << snap1->getNum(); + DBus::Marshaller marshaller(reply); + marshaller << snap1->getNum(); conn.send(reply); @@ -1033,8 +1033,8 @@ Client::create_post_snapshot(DBus::Connection& conn, DBus::Message& msg) unsigned int pre_num; SCD scd; - DBus::Hihi hihi(msg); - hihi >> config_name >> pre_num >> scd.description >> scd.cleanup >> scd.userdata; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> pre_num >> scd.description >> scd.cleanup >> scd.userdata; y2deb("CreatePostSnapshot config_name:" << config_name << " pre_num:" << pre_num << " description:" << scd.description << " cleanup:" << scd.cleanup); @@ -1060,8 +1060,8 @@ Client::create_post_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << snap2->getNum(); + DBus::Marshaller marshaller(reply); + marshaller << snap2->getNum(); conn.send(reply); @@ -1075,8 +1075,8 @@ Client::delete_snapshots(DBus::Connection& conn, DBus::Message& msg) string config_name; list nums; - DBus::Hihi hihi(msg); - hihi >> config_name >> nums; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> nums; y2deb("DeleteSnapshots config_name:" << config_name << " nums:" << nums); @@ -1113,8 +1113,8 @@ Client::get_default_snapshot(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("GetDefaultSnapshot config_name:" << config_name); @@ -1131,12 +1131,12 @@ Client::get_default_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); + DBus::Marshaller marshaller(reply); if (tmp != snapshots.end()) - hoho << true << tmp->getNum(); + marshaller << true << tmp->getNum(); else - hoho << false << (unsigned int)(0); + marshaller << false << (unsigned int)(0); conn.send(reply); } @@ -1147,8 +1147,8 @@ Client::get_active_snapshot(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("GetActiveSnapshot config_name:" << config_name); @@ -1165,12 +1165,12 @@ Client::get_active_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); + DBus::Marshaller marshaller(reply); if (tmp != snapshots.end()) - hoho << true << tmp->getNum(); + marshaller << true << tmp->getNum(); else - hoho << false << (unsigned int)(0); + marshaller << false << (unsigned int)(0); conn.send(reply); } @@ -1181,8 +1181,8 @@ Client::calculate_used_space(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("CalculateUsedSpace config_name:" << config_name); @@ -1208,8 +1208,8 @@ Client::get_used_space(DBus::Connection& conn, DBus::Message& msg) string config_name; dbus_uint32_t num; - DBus::Hihi hihi(msg); - hihi >> config_name >> num; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num; y2deb("GetUsedSpace config_name:" << config_name << " num:" << num); @@ -1231,8 +1231,8 @@ Client::get_used_space(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << used_space; + DBus::Marshaller marshaller(reply); + marshaller << used_space; conn.send(reply); } @@ -1245,8 +1245,8 @@ Client::mount_snapshot(DBus::Connection& conn, DBus::Message& msg) dbus_uint32_t num; bool user_request; - DBus::Hihi hihi(msg); - hihi >> config_name >> num >> user_request; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num >> user_request; y2deb("MountSnapshot config_name:" << config_name << " num:" << num << " user_request:" << user_request); @@ -1273,8 +1273,8 @@ Client::mount_snapshot(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << mount_point; + DBus::Marshaller marshaller(reply); + marshaller << mount_point; conn.send(reply); } @@ -1287,8 +1287,8 @@ Client::umount_snapshot(DBus::Connection& conn, DBus::Message& msg) dbus_uint32_t num; bool user_request; - DBus::Hihi hihi(msg); - hihi >> config_name >> num >> user_request; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num >> user_request; y2deb("UmountSnapshot config_name:" << config_name << " num:" << num << " user_request:" << user_request); @@ -1323,8 +1323,8 @@ Client::get_mount_point(DBus::Connection& conn, DBus::Message& msg) string config_name; dbus_uint32_t num; - DBus::Hihi hihi(msg); - hihi >> config_name >> num; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num; y2deb("GetMountPoint config_name:" << config_name << " num:" << num); @@ -1344,8 +1344,8 @@ Client::get_mount_point(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << mount_point; + DBus::Marshaller marshaller(reply); + marshaller << mount_point; conn.send(reply); } @@ -1357,8 +1357,8 @@ Client::create_comparison(DBus::Connection& conn, DBus::Message& msg) string config_name; dbus_uint32_t num1, num2; - DBus::Hihi hihi(msg); - hihi >> config_name >> num1 >> num2; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num1 >> num2; y2deb("CreateComparison config_name:" << config_name << " num1:" << num1 << " num2:" << num2); @@ -1387,9 +1387,9 @@ Client::create_comparison(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); + DBus::Marshaller marshaller(reply); dbus_uint32_t num_files = comparison->getFiles().size(); - hoho << num_files; + marshaller << num_files; conn.send(reply); } @@ -1401,8 +1401,8 @@ Client::delete_comparison(DBus::Connection& conn, DBus::Message& msg) string config_name; dbus_uint32_t num1, num2; - DBus::Hihi hihi(msg); - hihi >> config_name >> num1 >> num2; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num1 >> num2; y2deb("DeleteComparison config_name:" << config_name << " num1:" << num1 << " num2:" << num2); @@ -1429,8 +1429,8 @@ Client::get_files(DBus::Connection& conn, DBus::Message& msg) string config_name; dbus_uint32_t num1, num2; - DBus::Hihi hihi(msg); - hihi >> config_name >> num1 >> num2; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num1 >> num2; y2deb("GetFiles config_name:" << config_name << " num1:" << num1 << " num2:" << num2); @@ -1446,8 +1446,8 @@ Client::get_files(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << files; + DBus::Marshaller marshaller(reply); + marshaller << files; conn.send(reply); } @@ -1459,8 +1459,8 @@ Client::get_files_by_pipe(DBus::Connection& conn, DBus::Message& msg) string config_name; dbus_uint32_t num1, num2; - DBus::Hihi hihi(msg); - hihi >> config_name >> num1 >> num2; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name >> num1 >> num2; y2deb("GetFilesByPipe config_name:" << config_name << " num1:" << num1 << " num2:" << num2); @@ -1476,11 +1476,11 @@ Client::get_files_by_pipe(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); + DBus::Marshaller marshaller(reply); shared_ptr files_transfer_task = make_shared(files); - hoho << files_transfer_task->get_read_end(); + marshaller << files_transfer_task->get_read_end(); conn.send(reply); files_transfer_task->get_read_end().close(); @@ -1494,8 +1494,8 @@ Client::setup_quota(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("SetupQuota config_name:" << config_name); @@ -1520,8 +1520,8 @@ Client::prepare_quota(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("PrepareQuota config_name:" << config_name); @@ -1546,8 +1546,8 @@ Client::query_quota(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("QueryQuota config_name:" << config_name); @@ -1563,8 +1563,8 @@ Client::query_quota(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << quota_data; + DBus::Marshaller marshaller(reply); + marshaller << quota_data; conn.send(reply); } @@ -1575,8 +1575,8 @@ Client::query_free_space(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("QueryFreeSpace config_name:" << config_name); @@ -1592,8 +1592,8 @@ Client::query_free_space(DBus::Connection& conn, DBus::Message& msg) DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); - hoho << free_space_data; + DBus::Marshaller marshaller(reply); + marshaller << free_space_data; conn.send(reply); } @@ -1604,8 +1604,8 @@ Client::sync(DBus::Connection& conn, DBus::Message& msg) { string config_name; - DBus::Hihi hihi(msg); - hihi >> config_name; + DBus::Unmarshaller unmarshaller(msg); + unmarshaller >> config_name; y2deb("Sync config_name:" << config_name); @@ -1634,18 +1634,18 @@ Client::debug(DBus::Connection& conn, DBus::Message& msg) const DBus::MessageMethodReturn reply(msg); - DBus::Hoho hoho(reply); + DBus::Marshaller marshaller(reply); - hoho.open_array("s"); + marshaller.open_array("s"); - hoho << "server:"; + marshaller << "server:"; { std::ostringstream s; s << " pid:" << getpid(); - hoho << s.str(); + marshaller << s.str(); } - hoho << "clients:"; + marshaller << "clients:"; for (Clients::const_iterator it = clients.begin(); it != clients.end(); ++it) { std::ostringstream s; @@ -1658,18 +1658,18 @@ Client::debug(DBus::Connection& conn, DBus::Message& msg) const s << ", locks " << it->locks.size(); if (!it->comparisons.empty()) s << ", comparisons " << it->comparisons.size(); - hoho << s.str(); + marshaller << s.str(); } - hoho << "backgrounds:"; + marshaller << "backgrounds:"; for (Backgrounds::const_iterator it = clients.backgrounds().begin(); it != clients.backgrounds().end(); ++it) { std::ostringstream s; s << " name:'" << it->meta_snapper->configName() << "'"; - hoho << s.str(); + marshaller << s.str(); } - hoho << "meta-snappers:"; + marshaller << "meta-snappers:"; for (MetaSnappers::const_iterator it = meta_snappers.begin(); it != meta_snappers.end(); ++it) { std::ostringstream s; @@ -1682,14 +1682,14 @@ Client::debug(DBus::Connection& conn, DBus::Message& msg) const else s << ", use count " << it->use_count(); } - hoho << s.str(); + marshaller << s.str(); } - hoho << "compile options:"; - hoho << " version " + string(Snapper::compileVersion()); - hoho << " flags " + string(Snapper::compileFlags()); + marshaller << "compile options:"; + marshaller << " version " + string(Snapper::compileVersion()); + marshaller << " flags " + string(Snapper::compileFlags()); - hoho.close_array(); + marshaller.close_array(); conn.send(reply); } diff --git a/server/Types.cc b/server/Types.cc index 95db31df..db469bc0 100644 --- a/server/Types.cc +++ b/server/Types.cc @@ -33,95 +33,95 @@ namespace DBus const char* TypeInfo::signature = "(tt)"; - Hoho& - operator<<(Hoho& hoho, const ConfigInfo& data) + Marshaller& + operator<<(Marshaller& marshaller, const ConfigInfo& data) { - hoho.open_struct(); - hoho << data.get_config_name() << data.get_subvolume() << data.get_all_values(); - hoho.close_struct(); - return hoho; + marshaller.open_struct(); + marshaller << data.get_config_name() << data.get_subvolume() << data.get_all_values(); + marshaller.close_struct(); + return marshaller; } - Hihi& - operator>>(Hihi& hihi, SnapshotType& data) + Unmarshaller& + operator>>(Unmarshaller& unmarshaller, SnapshotType& data) { dbus_uint16_t tmp; - hihi >> tmp; + unmarshaller >> tmp; data = static_cast(tmp); - return hihi; + return unmarshaller; } - Hoho& - operator<<(Hoho& hoho, SnapshotType data) + Marshaller& + operator<<(Marshaller& marshaller, SnapshotType data) { - hoho << static_cast(data); - return hoho; + marshaller << static_cast(data); + return marshaller; } - Hoho& - operator<<(Hoho& hoho, const Snapshot& data) + Marshaller& + operator<<(Marshaller& marshaller, const Snapshot& data) { - hoho.open_struct(); - hoho << data.getNum() << data.getType() << data.getPreNum() << data.getDate() + marshaller.open_struct(); + marshaller << data.getNum() << data.getType() << data.getPreNum() << data.getDate() << data.getUid() << data.getDescription() << data.getCleanup() << data.getUserdata(); - hoho.close_struct(); - return hoho; + marshaller.close_struct(); + return marshaller; } - Hoho& - operator<<(Hoho& hoho, const Snapshots& data) + Marshaller& + operator<<(Marshaller& marshaller, const Snapshots& data) { - hoho.open_array(TypeInfo::signature); + marshaller.open_array(TypeInfo::signature); for (Snapshots::const_iterator it = data.begin(); it != data.end(); ++it) - hoho << *it; - hoho.close_array(); - return hoho; + marshaller << *it; + marshaller.close_array(); + return marshaller; } - Hoho& - operator<<(Hoho& hoho, const File& data) + Marshaller& + operator<<(Marshaller& marshaller, const File& data) { - hoho.open_struct(); - hoho << data.getName() << data.getPreToPostStatus(); - hoho.close_struct(); - return hoho; + marshaller.open_struct(); + marshaller << data.getName() << data.getPreToPostStatus(); + marshaller.close_struct(); + return marshaller; } - Hoho& - operator<<(Hoho& hoho, const QuotaData& data) + Marshaller& + operator<<(Marshaller& marshaller, const QuotaData& data) { - hoho.open_struct(); - hoho << data.size << data.used; - hoho.close_struct(); - return hoho; + marshaller.open_struct(); + marshaller << data.size << data.used; + marshaller.close_struct(); + return marshaller; } - Hoho& - operator<<(Hoho& hoho, const FreeSpaceData& data) + Marshaller& + operator<<(Marshaller& marshaller, const FreeSpaceData& data) { - hoho.open_struct(); - hoho << data.size << data.free; - hoho.close_struct(); - return hoho; + marshaller.open_struct(); + marshaller << data.size << data.free; + marshaller.close_struct(); + return marshaller; } - Hoho& - operator<<(Hoho& hoho, const Files& data) + Marshaller& + operator<<(Marshaller& marshaller, const Files& data) { - hoho.open_array(TypeInfo::signature); + marshaller.open_array(TypeInfo::signature); for (Files::const_iterator it = data.begin(); it != data.end(); ++it) - hoho << *it; - hoho.close_array(); - return hoho; + marshaller << *it; + marshaller.close_array(); + return marshaller; } } diff --git a/server/Types.h b/server/Types.h index 114ff2d6..a51fabd1 100644 --- a/server/Types.h +++ b/server/Types.h @@ -47,21 +47,21 @@ namespace DBus template <> struct TypeInfo { static const char* signature; }; template <> struct TypeInfo { static const char* signature; }; - Hoho& operator<<(Hoho& hoho, const ConfigInfo& data); + Marshaller& operator<<(Marshaller& marshaller, const ConfigInfo& data); - Hihi& operator>>(Hihi& hihi, SnapshotType& data); - Hoho& operator<<(Hoho& hoho, SnapshotType data); + Unmarshaller& operator>>(Unmarshaller& unmarshaller, SnapshotType& data); + Marshaller& operator<<(Marshaller& marshaller, SnapshotType data); - Hoho& operator<<(Hoho& hoho, const Snapshot& data); + Marshaller& operator<<(Marshaller& marshaller, const Snapshot& data); - Hoho& operator<<(Hoho& hoho, const Snapshots& data); + Marshaller& operator<<(Marshaller& marshaller, const Snapshots& data); - Hoho& operator<<(Hoho& hoho, const File& data); + Marshaller& operator<<(Marshaller& marshaller, const File& data); - Hoho& operator<<(Hoho& hoho, const Files& data); + Marshaller& operator<<(Marshaller& marshaller, const Files& data); - Hoho& operator<<(Hoho& hoho, const QuotaData& data); + Marshaller& operator<<(Marshaller& marshaller, const QuotaData& data); - Hoho& operator<<(Hoho& hoho, const FreeSpaceData& data); + Marshaller& operator<<(Marshaller& marshaller, const FreeSpaceData& data); } diff --git a/testsuite/dbus-escape.cc b/testsuite/dbus-escape.cc index cbb1f037..f73e822f 100644 --- a/testsuite/dbus-escape.cc +++ b/testsuite/dbus-escape.cc @@ -13,28 +13,28 @@ using namespace DBus; BOOST_AUTO_TEST_CASE(hoho_escape) { - BOOST_CHECK_EQUAL(Hoho::escape("\\"), "\\\\"); + BOOST_CHECK_EQUAL(Marshaller::escape("\\"), "\\\\"); - BOOST_CHECK_EQUAL(Hoho::escape("ä"), "\\xc3\\xa4"); - BOOST_CHECK_EQUAL(Hoho::escape("0ä0"), "0\\xc3\\xa40"); + BOOST_CHECK_EQUAL(Marshaller::escape("ä"), "\\xc3\\xa4"); + BOOST_CHECK_EQUAL(Marshaller::escape("0ä0"), "0\\xc3\\xa40"); - BOOST_CHECK_EQUAL(Hoho::escape("\xff"), "\\xff"); + BOOST_CHECK_EQUAL(Marshaller::escape("\xff"), "\\xff"); } BOOST_AUTO_TEST_CASE(hihi_unescape) { - BOOST_CHECK_EQUAL(Hihi::unescape("\\\\"), "\\"); + BOOST_CHECK_EQUAL(Unmarshaller::unescape("\\\\"), "\\"); - BOOST_CHECK_EQUAL(Hihi::unescape("\\xc3\\xa4"), "ä"); - BOOST_CHECK_EQUAL(Hihi::unescape("0\\xc3\\xa40"), "0ä0"); + BOOST_CHECK_EQUAL(Unmarshaller::unescape("\\xc3\\xa4"), "ä"); + BOOST_CHECK_EQUAL(Unmarshaller::unescape("0\\xc3\\xa40"), "0ä0"); - BOOST_CHECK_EQUAL(Hihi::unescape("\\xff"), "\xff"); + BOOST_CHECK_EQUAL(Unmarshaller::unescape("\\xff"), "\xff"); - BOOST_CHECK_THROW(Hihi::unescape("\\"), MarshallingException); - BOOST_CHECK_THROW(Hihi::unescape("\\x"), MarshallingException); - BOOST_CHECK_THROW(Hihi::unescape("\\x0"), MarshallingException); - BOOST_CHECK_THROW(Hihi::unescape("\\x0?"), MarshallingException); + BOOST_CHECK_THROW(Unmarshaller::unescape("\\"), MarshallingException); + BOOST_CHECK_THROW(Unmarshaller::unescape("\\x"), MarshallingException); + BOOST_CHECK_THROW(Unmarshaller::unescape("\\x0"), MarshallingException); + BOOST_CHECK_THROW(Unmarshaller::unescape("\\x0?"), MarshallingException); }