File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 16
16
#include < string>
17
17
#include < vector>
18
18
#include < memory>
19
- #include < regex>
20
19
21
- namespace o2
22
- {
23
- namespace framework
20
+
21
+ namespace o2 ::framework
24
22
{
25
23
26
24
namespace data_matcher
@@ -65,9 +63,9 @@ struct DataDescriptorQueryBuilder {
65
63
// / deprecated?
66
64
static DataDescriptorQuery buildFromExtendedKeepConfig (std::string const & config);
67
65
static std::unique_ptr<data_matcher::DataDescriptorMatcher> buildNode (std::string const & nodeString);
68
- static std::smatch getTokens (std::string const & nodeString);
66
+ static std::vector<std::string> getTokens (std::string const & nodeString);
69
67
};
70
68
71
- } // namespace framework
72
- } // namespace o2
69
+ } // namespace o2:: framework
70
+
73
71
#endif // o2_framework_DataDescriptorQueryBuilder_H_INCLUDED
Original file line number Diff line number Diff line change 17
17
#include < optional>
18
18
#include < string>
19
19
#include < vector>
20
+ #include < regex>
20
21
#include < iostream>
21
22
22
23
using namespace o2 ::framework::data_matcher;
@@ -447,7 +448,7 @@ DataDescriptorQuery DataDescriptorQueryBuilder::buildFromExtendedKeepConfig(std:
447
448
std::unique_ptr<DataDescriptorMatcher> DataDescriptorQueryBuilder::buildNode (std::string const & nodeString)
448
449
{
449
450
450
- std::smatch m = getTokens (nodeString);
451
+ auto m = getTokens (nodeString);
451
452
452
453
std::unique_ptr<DataDescriptorMatcher> next;
453
454
auto newNode = std::make_unique<DataDescriptorMatcher>(
@@ -461,15 +462,19 @@ std::unique_ptr<DataDescriptorMatcher> DataDescriptorQueryBuilder::buildNode(std
461
462
return newNode;
462
463
}
463
464
464
- std::smatch DataDescriptorQueryBuilder::getTokens (std::string const & nodeString)
465
+ std::vector<std::string> DataDescriptorQueryBuilder::getTokens (std::string const & nodeString)
465
466
{
466
467
467
468
static const std::regex specTokenRE (R"re( (\w{1,4})/(\w{1,16})/(\d*))re" );
468
- std::smatch m ;
469
+ std::smatch match ;
469
470
470
- std::regex_match (nodeString, m , specTokenRE);
471
+ std::regex_match (nodeString, match , specTokenRE);
471
472
472
- return m;
473
+ std::vector<std::string> result;
474
+ for (const auto & m : match) {
475
+ result.push_back (m.str ());
476
+ }
477
+ return result;
473
478
}
474
479
475
480
} // namespace o2::framework
You can’t perform that action at this time.
0 commit comments