groups.erase (groups.begin ());
}
-
+std::ostream &
+operator << (std::ostream &o, checkgroups const &groups)
+{
+ o << '[';
+ for (std::vector<std::string>::const_iterator it = groups.begin ();
+ it != groups.end (); ++it)
+ {
+ if (it != groups.begin ())
+ o << ',';
+ o << *it;
+ }
+ o << ']';
+ return o;
+}
#include <vector>
#include <string>
+#include <iosfwd>
+
+struct checkgroups
+ : public std::vector<std::string>
+{
+ checkgroups (std::vector<std::string> const &v)
+ : std::vector<std::string> (v)
+ {}
+};
+std::ostream &operator << (std::ostream &o, checkgroups const &groups);
struct checkdescriptor
{
- std::vector<std::string> groups;
+ checkgroups groups;
std::string const name;
checkdescriptor (std::string const &desc);
std::cout << cd.name << ' ' << what;
if (ext)
- {
- std::cout << " [";
- for (std::vector<std::string>::const_iterator it = cd.groups.begin ();
- it != cd.groups.end (); ++it)
- {
- if (it != cd.groups.begin ())
- std::cout << ',';
- std::cout << *it;
- }
- std::cout << "] {";
- for (checkstack::const_iterator it = stack.begin ();
- it != stack.end (); ++it)
- {
- if (it != stack.begin ())
- std::cout << ',';
- std::cout << (*it)->name;
- }
- std::cout << "}";
- }
+ std::cout << ' ' << cd.groups << ' ' << stack;
std::cout << std::endl;
}
#include <stdexcept>
#include <sstream>
+std::ostream &
+operator << (std::ostream &o, checkstack const &stack)
+{
+ o << "{";
+ for (checkstack::const_iterator it = stack.begin ();
+ it != stack.end (); ++it)
+ {
+ if (it != stack.begin ())
+ o << ',';
+ o << (*it)->name;
+ }
+ o << "}";
+ return o;
+}
+
namespace
{
int
#include <map>
#include <vector>
#include <stdexcept>
+#include <string>
+#include <iosfwd>
+
#include "../libelf/libelf.h"
#include "checks.ii"
#include "checkdescriptor.ii"
class checkstack
: public std::vector <checkdescriptor const *>
-{
-};
+{};
+std::ostream &operator << (std::ostream &o, checkstack const &stack);
struct check_rule
{