for (list<XSnapshots::const_iterator>::const_iterator it1 = tmp.begin(); it1 != tmp.end(); ++it1)
{
- if ((*it1)->getType() == XPRE)
+ if ((*it1)->getType() == PRE)
{
XSnapshots::const_iterator it2 = snapshots.findPost(*it1);
if (it2 != snapshots.end())
}
}
- if ((*it1)->getType() == XPOST)
+ if ((*it1)->getType() == POST)
{
XSnapshots::const_iterator it2 = snapshots.findPre(*it1);
if (it2 != snapshots.end())
for (XSnapshots::const_iterator it1 = snapshots.begin(); it1 != snapshots.end(); ++it1)
{
- if (it1->getType() == XPRE)
+ if (it1->getType() == PRE)
{
XSnapshots::const_iterator it2 = snapshots.findPost(it1);
for (XSnapshots::const_iterator it1 = snapshots.begin(); it1 != snapshots.end(); ++it1)
{
TableRow row;
- row.add(/*toString(*/ decString((int)(it1->getType())));
+ row.add(toString(it1->getType()));
row.add(decString(it1->getNum()));
- row.add(it1->getType() == XPOST ? decString(it1->getPreNum()) : "");
+ row.add(it1->getType() == POST ? decString(it1->getPreNum()) : "");
row.add(it1->isCurrent() ? "" : datetime(it1->getDate(), false, false));
row.add(it1->getCleanup());
row.add(it1->getDescription());
XSnapshots snapshots = command_list_xsnapshots(conn, config_name);
for (XSnapshots::const_iterator it1 = snapshots.begin(); it1 != snapshots.end(); ++it1)
{
- if (it1->getType() != XSINGLE)
+ if (it1->getType() != SINGLE)
continue;
TableRow row;
XSnapshots snapshots = command_list_xsnapshots(conn, config_name);
for (XSnapshots::const_iterator it1 = snapshots.begin(); it1 != snapshots.end(); ++it1)
{
- if (it1->getType() != XPRE)
+ if (it1->getType() != PRE)
continue;
XSnapshots::const_iterator it2 = snapshots.findPost(it1);
*/
+#include "snapper/SnapperTmpl.h"
+
#include "types.h"
+using namespace snapper;
+
+
XSnapshots::const_iterator
XSnapshots::findPre(const_iterator post) const
{
- if (post == entries.end() || post->isCurrent() || post->getType() != XPOST)
+ if (post == entries.end() || post->isCurrent() || post->getType() != POST)
throw;
for (const_iterator it = begin(); it != end(); ++it)
{
- if (it->getType() == XPRE && it->getNum() == post->getPreNum())
+ if (it->getType() == PRE && it->getNum() == post->getPreNum())
return it;
}
XSnapshots::const_iterator
XSnapshots::findPost(const_iterator pre) const
{
- if (pre == entries.end() || pre->isCurrent() || pre->getType() != XPRE)
+ if (pre == entries.end() || pre->isCurrent() || pre->getType() != PRE)
throw;
for (const_iterator it = begin(); it != end(); ++it)
{
- if (it->getType() == XPOST && it->getPreNum() == pre->getNum())
+ if (it->getType() == POST && it->getPreNum() == pre->getNum())
return it;
}
Hihi&
- operator>>(Hihi& hihi, XSnapshotType& data)
+ operator>>(Hihi& hihi, SnapshotType& data)
{
dbus_uint16_t tmp;
hihi >> tmp;
- data = static_cast<XSnapshotType>(tmp);
+ data = static_cast<SnapshotType>(tmp);
return hihi;
}
Hoho&
- operator<<(Hoho& hoho, XSnapshotType data)
+ operator<<(Hoho& hoho, SnapshotType data)
{
hoho << static_cast<dbus_uint16_t>(data);
return hoho;
#include "dbus/DBusConnection.h"
#include "dbus/DBusMessage.h"
+#include "snapper/Snapshot.h"
+
+using namespace snapper;
+
struct XConfigInfo
{
};
-enum XSnapshotType { XSINGLE, XPRE, XPOST };
-
-
struct XSnapshot
{
- XSnapshotType getType() const { return type; }
+ SnapshotType getType() const { return type; }
unsigned int getNum() const { return num; }
bool isCurrent() const { return num == 0; }
map<string, string> getUserdata() const { return userdata; }
- XSnapshotType type;
+ SnapshotType type;
unsigned int num;
time_t date;
unsigned int pre_num;
template <> struct TypeInfo<XUndo> { static const char* signature; };
Hihi& operator>>(Hihi& hihi, XConfigInfo& data);
- Hihi& operator>>(Hihi& hihi, XSnapshotType& data);
+
+ Hihi& operator>>(Hihi& hihi, SnapshotType& data);
+ Hoho& operator<<(Hoho& hoho, SnapshotType data);
+
Hihi& operator>>(Hihi& hihi, XSnapshot& data);
+
Hihi& operator>>(Hihi& hihi, XFile& data);
- Hoho& operator<<(Hoho& hoho, XSnapshotType data);
Hoho& operator<<(Hoho& hoho, const XUndo& data);
};