vector<XConfigInfo> ret;
- DBus::Hihi hihi(reply);
- hihi >> ret;
+ DBus::Unmarshaller unmarshaller(reply);
+ unmarshaller >> ret;
return ret;
}
{
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;
}
{
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);
}
{
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);
}
{
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);
}
{
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;
}
{
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;
}
{
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);
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
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);
}
{
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);
}
{
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);
}
{
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);
}
{
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;
}
{
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;
}
{
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);
}
{
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;
}
{
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);
}
{
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);
}
{
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<XFile> files;
- DBus::Hihi hihi(reply);
- hihi >> files;
+ DBus::Unmarshaller unmarshaller(reply);
+ unmarshaller >> files;
return files;
}
{
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<XFile> files;
{
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);
}
{
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);
}
{
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;
}
{
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;
}
{
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);
}
vector<string> lines;
- DBus::Hihi hihi(reply);
- hihi >> lines;
+ DBus::Unmarshaller unmarshaller(reply);
+ unmarshaller >> lines;
return lines;
}
const char* TypeInfo<XFile>::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<SnapshotType>(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<dbus_uint16_t>(data);
- return hoho;
+ marshaller << static_cast<dbus_uint16_t>(data);
+ return marshaller;
}
}
template <> struct TypeInfo<XConfigInfo> { static const char* signature; };
template <> struct TypeInfo<XFile> { 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);
}
{
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);
const char* TypeInfo<string>::signature = "s";
- Hihi::Hihi(Message& msg)
+ Unmarshaller::Unmarshaller(Message& msg)
{
iters.push_back(new DBusMessageIter());
if (!dbus_message_iter_init(msg.get_message(), top()))
}
- Hihi::~Hihi()
+ Unmarshaller::~Unmarshaller()
{
delete iters.back();
iters.pop_back();
void
- Hihi::open_recurse()
+ Unmarshaller::open_recurse()
{
DBusMessageIter* iter2 = new DBusMessageIter();
dbus_message_iter_recurse(top(), iter2);
void
- Hihi::close_recurse()
+ Unmarshaller::close_recurse()
{
delete iters.back();
iters.pop_back();
}
- 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();
}
void
- Hoho::open_struct()
+ Marshaller::open_struct()
{
DBusMessageIter* iter2 = new DBusMessageIter();
if (!dbus_message_iter_open_container(top(), DBUS_TYPE_STRUCT, NULL, iter2))
void
- Hoho::close_struct()
+ Marshaller::close_struct()
{
DBusMessageIter* iter2 = top();
iters.pop_back();
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))
void
- Hoho::close_array()
+ Marshaller::close_array()
{
DBusMessageIter* iter2 = top();
iters.pop_back();
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))
void
- Hoho::close_dict_entry()
+ Marshaller::close_dict_entry()
{
DBusMessageIter* iter2 = top();
iters.pop_back();
}
- 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;
}
- 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;
}
- 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<string, string>& data)
+ Unmarshaller&
+ operator>>(Unmarshaller& unmarshaller, map<string, string>& 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<string, string>& data)
+ Marshaller&
+ operator<<(Marshaller& marshaller, const map<string, string>& data)
{
- hoho.open_array("{ss}");
+ marshaller.open_array("{ss}");
for (map<string, string>::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;
}
}
};
- class Hihi : public Marshalling
+ class Unmarshaller : public Marshalling
{
public:
- Hihi(Message& msg);
- ~Hihi();
+ Unmarshaller(Message& msg);
+ ~Unmarshaller();
void open_recurse();
void close_recurse();
};
- class Hoho : public Marshalling
+ class Marshaller : public Marshalling
{
public:
- Hoho(Message& msg);
- ~Hoho();
+ Marshaller(Message& msg);
+ ~Marshaller();
void open_struct();
void close_struct();
};
- 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<string, string>& data);
- Hoho& operator<<(Hoho& hoho, const map<string, string>& data);
+ Unmarshaller& operator>>(Unmarshaller& unmarshaller, map<string, string>& data);
+ Marshaller& operator<<(Marshaller& marshaller, const map<string, string>& data);
template <typename Type>
- Hihi& operator>>(Hihi& hihi, vector<Type>& data)
+ Unmarshaller& operator>>(Unmarshaller& unmarshaller, vector<Type>& 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<Type>::signature)
+ if (unmarshaller.get_signature() != TypeInfo<Type>::signature)
throw MarshallingException();
Type tmp;
- hihi >> tmp;
+ unmarshaller >> tmp;
data.push_back(tmp);
}
- hihi.close_recurse();
+ unmarshaller.close_recurse();
- return hihi;
+ return unmarshaller;
}
template <typename Type>
- Hoho& operator<<(Hoho& hoho, const vector<Type>& data)
+ Marshaller& operator<<(Marshaller& marshaller, const vector<Type>& data)
{
- hoho.open_array(TypeInfo<Type>::signature);
+ marshaller.open_array(TypeInfo<Type>::signature);
for (typename vector<Type>::const_iterator it = data.begin(); it != data.end(); ++it)
{
- hoho << *it;
+ marshaller << *it;
}
- hoho.close_array();
+ marshaller.close_array();
- return hoho;
+ return marshaller;
}
template <typename Type>
- Hihi& operator>>(Hihi& hihi, list<Type>& data)
+ Unmarshaller& operator>>(Unmarshaller& unmarshaller, list<Type>& 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<Type>::signature)
+ if (unmarshaller.get_signature() != TypeInfo<Type>::signature)
throw MarshallingException();
Type tmp;
- hihi >> tmp;
+ unmarshaller >> tmp;
data.push_back(tmp);
}
- hihi.close_recurse();
+ unmarshaller.close_recurse();
- return hihi;
+ return unmarshaller;
}
template <typename Type>
- Hoho& operator<<(Hoho& hoho, const list<Type>& data)
+ Marshaller& operator<<(Marshaller& marshaller, const list<Type>& data)
{
- hoho.open_array(TypeInfo<Type>::signature);
+ marshaller.open_array(TypeInfo<Type>::signature);
for (typename list<Type>::const_iterator it = data.begin(); it != data.end(); ++it)
{
- hoho << *it;
+ marshaller << *it;
}
- hoho.close_array();
+ marshaller.close_array();
- return hoho;
+ return marshaller;
}
}
}
- 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;
}
string
Pipe::unescape(const string& in)
{
- return Hihi::unescape(in);
+ return Unmarshaller::unescape(in);
}
}
};
- 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
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << introspect;
+ DBus::Marshaller marshaller(reply);
+ marshaller << introspect;
conn.send(reply);
}
{
DBus::MessageSignal msg(PATH, INTERFACE, "ConfigCreated");
- DBus::Hoho hoho(msg);
- hoho << config_name;
+ DBus::Marshaller marshaller(msg);
+ marshaller << config_name;
conn.send(msg);
}
{
DBus::MessageSignal msg(PATH, INTERFACE, "ConfigModified");
- DBus::Hoho hoho(msg);
- hoho << config_name;
+ DBus::Marshaller marshaller(msg);
+ marshaller << config_name;
conn.send(msg);
}
{
DBus::MessageSignal msg(PATH, INTERFACE, "ConfigDeleted");
- DBus::Hoho hoho(msg);
- hoho << config_name;
+ DBus::Marshaller marshaller(msg);
+ marshaller << config_name;
conn.send(msg);
}
{
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);
}
{
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);
}
{
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);
}
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho.open_array(DBus::TypeInfo<ConfigInfo>::signature);
+ DBus::Marshaller marshaller(reply);
+ marshaller.open_array(DBus::TypeInfo<ConfigInfo>::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);
}
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("GetConfig config_name:" << config_name);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << it->getConfigInfo();
+ DBus::Marshaller marshaller(reply);
+ marshaller << it->getConfigInfo();
conn.send(reply);
}
{
string config_name;
- DBus::Hihi hihi(msg);
+ DBus::Unmarshaller unmarshaller(msg);
map<string, string> raw;
- hihi >> config_name >> raw;
+ unmarshaller >> config_name >> raw;
y2deb("SetConfig config_name:" << config_name << " raw:" << raw);
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);
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("DeleteConfig config_name:" << config_name);
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("LockConfig config_name:" << config_name);
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("UnlockConfig config_name:" << config_name);
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("ListSnapshots config_name:" << config_name);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << snapshots;
+ DBus::Marshaller marshaller(reply);
+ marshaller << snapshots;
conn.send(reply);
}
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
+ DBus::Marshaller marshaller(reply);
- hoho.open_array(DBus::TypeInfo<Snapshot>::signature);
+ marshaller.open_array(DBus::TypeInfo<Snapshot>::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);
}
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << *snap;
+ DBus::Marshaller marshaller(reply);
+ marshaller << *snap;
conn.send(reply);
}
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);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << snap1->getNum();
+ DBus::Marshaller marshaller(reply);
+ marshaller << snap1->getNum();
conn.send(reply);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << snap2->getNum();
+ DBus::Marshaller marshaller(reply);
+ marshaller << snap2->getNum();
conn.send(reply);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << snap->getNum();
+ DBus::Marshaller marshaller(reply);
+ marshaller << snap->getNum();
conn.send(reply);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << snap1->getNum();
+ DBus::Marshaller marshaller(reply);
+ marshaller << snap1->getNum();
conn.send(reply);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << snap2->getNum();
+ DBus::Marshaller marshaller(reply);
+ marshaller << snap2->getNum();
conn.send(reply);
string config_name;
list<dbus_uint32_t> 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);
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("GetDefaultSnapshot config_name:" << config_name);
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);
}
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("GetActiveSnapshot config_name:" << config_name);
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);
}
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("CalculateUsedSpace config_name:" << config_name);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << used_space;
+ DBus::Marshaller marshaller(reply);
+ marshaller << used_space;
conn.send(reply);
}
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << mount_point;
+ DBus::Marshaller marshaller(reply);
+ marshaller << mount_point;
conn.send(reply);
}
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);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << mount_point;
+ DBus::Marshaller marshaller(reply);
+ marshaller << mount_point;
conn.send(reply);
}
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);
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);
}
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);
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << files;
+ DBus::Marshaller marshaller(reply);
+ marshaller << files;
conn.send(reply);
}
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);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
+ DBus::Marshaller marshaller(reply);
shared_ptr<FilesTransferTask> files_transfer_task = make_shared<FilesTransferTask>(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();
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("SetupQuota config_name:" << config_name);
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("PrepareQuota config_name:" << config_name);
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("QueryQuota config_name:" << config_name);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << quota_data;
+ DBus::Marshaller marshaller(reply);
+ marshaller << quota_data;
conn.send(reply);
}
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("QueryFreeSpace config_name:" << config_name);
DBus::MessageMethodReturn reply(msg);
- DBus::Hoho hoho(reply);
- hoho << free_space_data;
+ DBus::Marshaller marshaller(reply);
+ marshaller << free_space_data;
conn.send(reply);
}
{
string config_name;
- DBus::Hihi hihi(msg);
- hihi >> config_name;
+ DBus::Unmarshaller unmarshaller(msg);
+ unmarshaller >> config_name;
y2deb("Sync config_name:" << config_name);
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;
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;
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);
}
const char* TypeInfo<FreeSpaceData>::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<SnapshotType>(tmp);
- return hihi;
+ return unmarshaller;
}
- Hoho&
- operator<<(Hoho& hoho, SnapshotType data)
+ Marshaller&
+ operator<<(Marshaller& marshaller, SnapshotType data)
{
- hoho << static_cast<dbus_uint16_t>(data);
- return hoho;
+ marshaller << static_cast<dbus_uint16_t>(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<Snapshot>::signature);
+ marshaller.open_array(TypeInfo<Snapshot>::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<File>::signature);
+ marshaller.open_array(TypeInfo<File>::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;
}
}
template <> struct TypeInfo<QuotaData> { static const char* signature; };
template <> struct TypeInfo<FreeSpaceData> { 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);
}
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);
}