Skip to content

Commit cd3e507

Browse files
committed
Update to use second constructor for list of strings
1 parent b457597 commit cd3e507

File tree

6 files changed

+13
-31
lines changed

6 files changed

+13
-31
lines changed

src/filepattern/cpp/bindings.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ PYBIND11_MODULE(backend, m){
2323
const std::string&,
2424
const std::string&,
2525
bool,
26+
bool>())
27+
.def(py::init<const std::vector<std::string>&,
28+
const std::string&,
2629
bool,
27-
const std::vector<std::string>&>())
30+
bool>())
2831
.def("getMatching", &FilePattern::getMatching)
2932
.def("getOccurrences", &FilePattern::getOccurrences)
3033
.def("getUniqueValues", &FilePattern::getUniqueValues)

src/filepattern/cpp/interface/filepattern.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
#include <tuple>
66

7-
FilePattern::FilePattern(const std::string& path, const std::string& filePattern, const std::string& block_size, bool recursive, bool suppressWarnings, const std::vector<std::string>& file_array) {
7+
FilePattern::FilePattern(const std::string& path, const std::string& filePattern, const std::string& block_size, bool recursive, bool suppressWarnings) {
88

99
FilePatternFactory fpf = FilePatternFactory();
1010

11-
this->fp_ = std::unique_ptr<PatternObject>(fpf.getObject(path, filePattern, block_size, recursive, suppressWarnings, file_array));
11+
this->fp_ = std::unique_ptr<PatternObject>(fpf.getObject(path, filePattern, block_size, recursive, suppressWarnings, std::vector<std::string>{}));
1212

1313
if (block_size != "") {
1414
this->fp_->external = true;

src/filepattern/filepattern.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,10 @@ def __init__(
409409
"""
410410

411411
if (isinstance(input, list)):
412-
self._file_pattern = backend.FilePattern("", pattern, block_size, recursive, suppress_warnings, input)
412+
self._file_pattern = backend.FilePattern(input, pattern, recursive, suppress_warnings)
413413
elif (isinstance(input, str) or isinstance(input, Path)):
414414
input = str(input) # change path type to string to support pathlib paths
415-
self._file_pattern = backend.FilePattern(input, pattern, block_size, recursive, suppress_warnings, [])
415+
self._file_pattern = backend.FilePattern(input, pattern, block_size, recursive, suppress_warnings)
416416
else:
417417
raise TypeError("Error: input type must either be a string/path to a file or directory or a list of strings")
418418

src/filepattern/java/FilePattern.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
*/
3636
public class FilePattern implements Iterable{
3737

38-
private FilePatternBindings.FilePatternJava fp;
38+
private FilePatternBindings.FilePattern fp;
3939
private FilePatternBuilder builder;
4040
private boolean external;
4141
private ArrayList<String> groups = new ArrayList<>();
@@ -90,7 +90,7 @@ public FilePattern build() throws IOException {
9090
private FilePattern(FilePatternBuilder builder) throws IOException {
9191

9292
this.builder = builder;
93-
this.fp = new FilePatternBindings.FilePatternJava(builder.path, builder.filePattern, builder.blockSize, builder.recursive, builder.suppressWarnings); // need to add builder to FPOjbect
93+
this.fp = new FilePatternBindings.FilePattern(builder.path, builder.filePattern, builder.blockSize, builder.recursive, builder.suppressWarnings); // need to add builder to FPOjbect
9494

9595
}
9696

src/filepattern/java/FilePatternBindings.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"../cpp/external/external_stringpattern.hpp",
5353
"../cpp/external/external_vectorpattern.cpp",
5454
"../cpp/external/external_vectorpattern.hpp",
55-
"filepattern.h",
55+
"../cpp/include/filepattern.h",
5656
"../cpp/interface/filepattern.cpp",
5757
"../cpp/pattern_object.hpp",
5858
"../cpp/util/util.hpp",
@@ -827,11 +827,11 @@ public static class VariantVector extends Pointer {
827827
public native @Cast("bool") boolean empty();
828828
}
829829

830-
public static class FilePatternJava extends Pointer{
830+
public static class FilePattern extends Pointer{
831831

832832
static { Loader.load(); }
833833

834-
public FilePatternJava(String path, String filePattern, String blockSize, boolean recursive, boolean suppress_warnings) {
834+
public FilePattern(String path, String filePattern, String blockSize, boolean recursive, boolean suppress_warnings) {
835835
allocate(path, filePattern, blockSize, recursive, suppress_warnings);
836836
}
837837

src/filepattern/java/filepattern.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)