Skip to content

Commit 4d05ef2

Browse files
committed
fdsdump: get rid of FileList component
1 parent b8e0a7d commit 4d05ef2

File tree

9 files changed

+11
-228
lines changed

9 files changed

+11
-228
lines changed

src/tools/fdsdump/src/aggregator/mode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ mode_aggregate(const Options &opts)
4242
flows.set_filter(opts.get_input_filter());
4343
}
4444

45-
for (const auto &it : opts.get_input_files()) {
45+
for (const auto &it : glob_files(opts.get_input_file_patterns())) {
4646
flows.add_file(it);
4747
}
4848

src/tools/fdsdump/src/common/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set(COMMON_SRC
44
common.cpp
55
field.cpp
66
fieldView.cpp
7-
filelist.cpp
87
flowProvider.cpp
98
ipaddr.cpp
109
ieMgr.cpp

src/tools/fdsdump/src/common/filelist.cpp

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

src/tools/fdsdump/src/common/filelist.hpp

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

src/tools/fdsdump/src/lister/lister.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* SPDX-License-Identifier: BSD-3-Clause
99
*/
1010

11+
#include <common/common.hpp>
1112
#include <lister/lister.hpp>
1213
#include <lister/printer.hpp>
1314
#include <lister/storageSorted.hpp>
@@ -75,7 +76,7 @@ mode_list(const Options &opts)
7576
flows.set_filter(opts.get_input_filter());
7677
}
7778

78-
for (const auto &it : opts.get_input_files()) {
79+
for (const auto &it : glob_files(opts.get_input_file_patterns())) {
7980
flows.add_file(it);
8081
}
8182

src/tools/fdsdump/src/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <libfds.h>
1616

1717
#include <common/common.hpp>
18-
#include <common/filelist.hpp>
1918
#include <lister/lister.hpp>
2019
#include <aggregator/mode.hpp>
2120
#include <statistics/mode.hpp>

src/tools/fdsdump/src/options.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void Options::reset()
5353
m_help_flag = false;
5454
m_mode = Mode::undefined;
5555

56-
m_input_files.clear();
56+
m_input_file_patterns.clear();
5757
m_input_filter.clear();
5858

5959
m_output_limit = 0;
@@ -103,9 +103,7 @@ void Options::parse(int argc, char *argv[])
103103
}
104104

105105
if (args.has('r')) {
106-
for (const auto &arg : args.get_all('r')) {
107-
m_input_files.add_files(arg);
108-
}
106+
m_input_file_patterns = args.get_all('r');
109107
}
110108

111109
if (args.has('c')) {

src/tools/fdsdump/src/options.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212

1313
#include <cstddef>
1414
#include <string>
15+
#include <vector>
1516
#include <stdexcept>
1617

17-
#include <common/filelist.hpp>
18-
1918
namespace fdsdump {
2019

2120
class OptionsException : public std::invalid_argument {
@@ -69,8 +68,8 @@ class Options {
6968

7069
const Mode &get_mode() const { return m_mode; };
7170

72-
/** @brief Get list of files to process. */
73-
const FileList &get_input_files() const { return m_input_files; };
71+
/** @brief Get list of provided file patterns to process. */
72+
const std::vector<std::string> &get_input_file_patterns() const { return m_input_file_patterns; };
7473
/** @brief Get input flow filter. */
7574
const std::string &get_input_filter() const { return m_input_filter; };
7675

@@ -95,7 +94,7 @@ class Options {
9594

9695
bool m_help_flag;
9796

98-
FileList m_input_files;
97+
std::vector<std::string> m_input_file_patterns;
9998
std::string m_input_filter;
10099

101100
size_t m_output_limit;

src/tools/fdsdump/src/statistics/mode.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <iostream>
1111

12+
#include <common/common.hpp>
1213
#include <common/flowProvider.hpp>
1314

1415
#include <statistics/mode.hpp>
@@ -48,7 +49,7 @@ void
4849
mode_statistics(const Options &opts)
4950
{
5051
auto printer = printer_factory(opts.get_output_specifier());
51-
const FileList &file_names = opts.get_input_files();
52+
std::vector<std::string> file_names = glob_files(opts.get_input_file_patterns());
5253
unique_file file {nullptr, &fds_file_close};
5354
fds_file_stats stats {};
5455

0 commit comments

Comments
 (0)