Revision: 75801
http://sourceforge.net/p/brlcad/code/75801
Author: starseeker
Date: 2020-05-14 15:20:34 +0000 (Thu, 14 May 2020)
Log Message:
-----------
Don't actually need regex for the initial rejection filters or the hdrfile
categorization.
Modified Paths:
--------------
brlcad/trunk/regress/repository/repocheck.cpp
Modified: brlcad/trunk/regress/repository/repocheck.cpp
===================================================================
--- brlcad/trunk/regress/repository/repocheck.cpp 2020-05-14 15:09:00 UTC
(rev 75800)
+++ brlcad/trunk/regress/repository/repocheck.cpp 2020-05-14 15:20:34 UTC
(rev 75801)
@@ -631,36 +631,25 @@
// Build a set of filters that will cull out files which would otherwise
// be matches for items of interest
const char *reject_filters[] {
- ".*/bullet/.*",
- ".*/doc/.*",
- ".*/shapelib/.*",
- ".*[.]log",
- ".*[.]svn.*",
- ".*misc/CMake/Find.*",
- ".*misc/repoconv.*",
- ".*misc/tools.*",
- ".*misc/debian.*",
- ".*pkg.h",
- ".*src/libpkg.*",
- ".*src/other.*",
- ".*~",
+ "/bullet/",
+ "/doc/",
+ "/shapelib/",
+ ".log",
+ ".svn",
+ "misc/CMake/Find",
+ "misc/repoconv",
+ "misc/tools",
+ "misc/debian",
+ "pkg.h",
+ "src/libpkg",
+ "src/other/",
+ "~",
NULL
};
- std::vector<std::regex> filters;
- int cnt = 0;
- const char *rf = reject_filters[cnt];
- while (rf) {
- filters.push_back(std::regex(rf));
- cnt++;
- rf = reject_filters[cnt];
- }
-
-
// Apply filters and build up the file sets we want to introspect.
std::regex codefile_regex(".*[.](c|cpp|cxx|cc|h|hpp|hxx|y|yy|l)([.]in)?$");
std::regex buildfile_regex(".*([.]cmake([.]in)?|CMakeLists.txt)$");
- std::regex hdrfile_regex(".*/include/.*");
std::vector<std::string> src_files;
std::vector<std::string> inc_files;
std::vector<std::string> build_files;
@@ -667,11 +656,16 @@
while (std::getline(src_file_stream, sfile)) {
bool reject = false;
- for (size_t i = 0; i < filters.size(); i++) {
- if (std::regex_match(sfile, filters[i])) {
+
+ int cnt = 0;
+ const char *rf = reject_filters[cnt];
+ while (rf) {
+ if (std::strstr(sfile.c_str(), rf)) {
reject = true;
break;
}
+ cnt++;
+ rf = reject_filters[cnt];
}
if (reject) {
continue;
@@ -678,7 +672,7 @@
}
if (std::regex_match(sfile, codefile_regex)) {
- if (std::regex_match(sfile, hdrfile_regex)) {
+ if (std::strstr(sfile.c_str(), "include")) {
inc_files.push_back(sfile);
} else {
src_files.push_back(sfile);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits