]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Move checkdescriptor to module of its own
authorPetr Machata <pmachata@redhat.com>
Fri, 27 Aug 2010 15:39:15 +0000 (17:39 +0200)
committerPetr Machata <pmachata@redhat.com>
Fri, 27 Aug 2010 15:39:15 +0000 (17:39 +0200)
dwarflint/Makefile.am
dwarflint/checkdescriptor.cc [new file with mode: 0644]
dwarflint/checkdescriptor.hh [new file with mode: 0644]
dwarflint/checkdescriptor.ii [new file with mode: 0644]
dwarflint/checks.cc
dwarflint/checks.hh
dwarflint/checks.ii
dwarflint/dwarflint.hh

index f9bbefb7aa77e597711f09f98ebcff7419f38ae6..a79b8cfb382b1881b35cd6156841de16f4847a0b 100644 (file)
@@ -39,6 +39,7 @@ bin_PROGRAMS = dwarflint
 
 dwarflint_SOURCES = \
        main.cc \
+       checkdescriptor.cc checkdescriptor.hh checkdescriptor.ii \
        dwarflint.cc dwarflint.hh misc.h \
        low.c low.h \
        expected-at.cc expected.hh \
diff --git a/dwarflint/checkdescriptor.cc b/dwarflint/checkdescriptor.cc
new file mode 100644 (file)
index 0000000..0f1d514
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+   This file is part of Red Hat elfutils.
+
+   Red Hat elfutils is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by the
+   Free Software Foundation; version 2 of the License.
+
+   Red Hat elfutils is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with Red Hat elfutils; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+   Red Hat elfutils is an included package of the Open Invention Network.
+   An included package of the Open Invention Network is a package for which
+   Open Invention Network licensees cross-license their patents.  No patent
+   license is granted, either expressly or impliedly, by designation as an
+   included package.  Should you wish to participate in the Open Invention
+   Network licensing program, please visit www.openinventionnetwork.com
+   <http://www.openinventionnetwork.com>.  */
+
+#include "checkdescriptor.hh"
+#include <sstream>
+
+namespace
+{
+  std::vector<std::string>
+  split_groups (std::string const &str)
+  {
+    std::stringstream ss (str);
+    std::string item;
+    std::vector<std::string> ret;
+
+    while (ss >> item)
+      ret.push_back (item);
+
+    return ret;
+  }
+}
+
+checkdescriptor::checkdescriptor (std::string const &desc)
+  : groups (::split_groups (desc))
+  , name (groups[0])
+{
+  groups.erase (groups.begin ());
+}
+
+
diff --git a/dwarflint/checkdescriptor.hh b/dwarflint/checkdescriptor.hh
new file mode 100644 (file)
index 0000000..d04b9e3
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+   This file is part of Red Hat elfutils.
+
+   Red Hat elfutils is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by the
+   Free Software Foundation; version 2 of the License.
+
+   Red Hat elfutils is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with Red Hat elfutils; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
+
+   Red Hat elfutils is an included package of the Open Invention Network.
+   An included package of the Open Invention Network is a package for which
+   Open Invention Network licensees cross-license their patents.  No patent
+   license is granted, either expressly or impliedly, by designation as an
+   included package.  Should you wish to participate in the Open Invention
+   Network licensing program, please visit www.openinventionnetwork.com
+   <http://www.openinventionnetwork.com>.  */
+
+#ifndef DWARFLINT_CHECKDESCRIPTOR_HH
+#define DWARFLINT_CHECKDESCRIPTOR_HH
+
+#include <vector>
+#include <string>
+
+struct checkdescriptor
+{
+  std::vector<std::string> groups;
+  std::string const name;
+
+  checkdescriptor (std::string const &desc);
+};
+
+#endif//DWARFLINT_CHECKDESCRIPTOR_HH
diff --git a/dwarflint/checkdescriptor.ii b/dwarflint/checkdescriptor.ii
new file mode 100644 (file)
index 0000000..052fe1b
--- /dev/null
@@ -0,0 +1 @@
+struct checkdescriptor;
index 10525383ba5b16941aa6a49028970d70721185de..2337fb7926f3849f60b80cee5e85da39db67cafd 100644 (file)
 
 #include "checks.hh"
 #include "options.h"
-#include <sstream>
-
-namespace
-{
-  std::vector<std::string>
-  split_groups (std::string const &str)
-  {
-    std::stringstream ss (str);
-    std::string item;
-    std::vector<std::string> ret;
-
-    while (ss >> item)
-      ret.push_back (item);
-
-    return ret;
-  }
-}
-
-checkdescriptor::checkdescriptor (std::string const &desc)
-  : groups (::split_groups (desc))
-  , name (groups[0])
-{
-  groups.erase (groups.begin ());
-}
-
 
 reporter::reporter (checkstack const &s, checkdescriptor const &a_cd)
   : stack (s)
index 8f9ea6d7df7228525115c53e1ed0d14d4674aa76..146894c283eaa8adb38eb96aa2997222ed897b8d 100644 (file)
 
 #include "where.h"
 #include "dwarflint.hh"
+#include "checkdescriptor.hh"
 #include <string>
 #include <cassert>
 
-struct checkdescriptor
-{
-  std::vector<std::string> groups;
-  std::string const name;
-
-  checkdescriptor (std::string const &desc);
-};
-
 struct check_base
 {
   struct failed {};
index 9db9722b46026a65e67f47cd2a685b47d2962904..b9ca68df792e38289be5da9070c494f2e4becf33 100644 (file)
@@ -1,2 +1 @@
 struct check_base;
-struct checkdescriptor;
index 968cfb66ff5ae8629639c1ef82360c7f99df2ee4..ccd0bdf9608cbf8f46573875ee4cacd0bcccc409 100644 (file)
@@ -31,6 +31,7 @@
 #include <stdexcept>
 #include "../libelf/libelf.h"
 #include "checks.ii"
+#include "checkdescriptor.ii"
 
 class checkstack
   : public std::vector <checkdescriptor const *>