getChildValue(node, "cleanup", snapshot.cleanup);
- const list<const xmlNode*> l = getChildNodes(node, "userdata");
- for (list<const xmlNode*>::const_iterator it2 = l.begin(); it2 != l.end(); ++it2)
+ const vector<const xmlNode*> l = getChildNodes(node, "userdata");
+ for (vector<const xmlNode*>::const_iterator it2 = l.begin(); it2 != l.end(); ++it2)
{
string key, value;
getChildValue(*it2, "key", key);
/*
* Copyright (c) [2010-2012] Novell, Inc.
- * Copyright (c) [2020-2022] SUSE LLC
+ * Copyright (c) [2020-2023] SUSE LLC
*
* All Rights Reserved.
*
*/
-#include <string.h>
+#include <cstring>
#include <unistd.h>
#include "snapper/Exception.h"
}
- list<const xmlNode*>
+ vector<const xmlNode*>
getChildNodes(const xmlNode* node, const char* name)
{
- list<const xmlNode*> ret;
+ vector<const xmlNode*> ret;
if (node != NULL)
node = node->children;
/*
* Copyright (c) [2010-2012] Novell, Inc.
+ * Copyright (c) 2023 SUSE LLC
*
* All Rights Reserved.
*
#include <libxml/tree.h>
#include <string>
-#include <list>
+#include <vector>
#include <sstream>
#include <boost/noncopyable.hpp>
namespace snapper
{
using std::string;
- using std::list;
+ using std::vector;
class XmlFile : private boost::noncopyable
const xmlNode* getChildNode(const xmlNode* node, const char* name);
- list<const xmlNode*> getChildNodes(const xmlNode* node, const char* name);
+ vector<const xmlNode*> getChildNodes(const xmlNode* node, const char* name);
bool getValue(const xmlNode* node, string& value);
}
template<typename Type>
- void setChildValue(xmlNode* node, const char* name, const list<Type>& values)
+ void setChildValue(xmlNode* node, const char* name, const vector<Type>& values)
{
- for (typename list<Type>::const_iterator it = values.begin(); it != values.end(); ++it)
+ for (typename vector<Type>::const_iterator it = values.begin(); it != values.end(); ++it)
setChildValue(node, name, *it);
}
const xmlNode* root = config.getRootElement();
const xmlNode* solvables_n = getChildNode(root, "solvables");
- const list<const xmlNode*> solvables_l = getChildNodes(solvables_n, "solvable");
+ const vector<const xmlNode*> solvables_l = getChildNodes(solvables_n, "solvable");
for (const xmlNode* node : solvables_l)
{
string pattern;