Replies: 2 comments
-
Hi! constexpr auto prefix = "data/S123/2";
for ( const auto& item : reader ) {
if ( item.path().rfind( prefix, 0 ) != 0 ) { // Or C++20's starts_with method.
continue;
}
// The current item starts with the prefix
// ...
} I'll definitely add some convenience methods to achieve the same result with a more clean approach. |
Beta Was this translation helpful? Give feedback.
-
Thank you! I'll try that.
…On Mon, Oct 14, 2024, 12:15 PM Riccardo ***@***.***> wrote:
Hi!
Sorry for the late reply.
Unfortunately, there's no direct method for this, at least at the moment.
Obviously, you can achieve the same result by looping over the archive
reader and filtering the items, e.g.:
const auto prefix = "data/S123/2";for ( const auto& item : reader ) {
if ( item.path().rfind( prefix, 0 ) != 0 ) { // Or C++20's starts_with method.
continue;
}
// The current item starts with the prefix
// ...
}
I'll definitely add some convenience methods to achieve the same result
with a more clean approach.
For example, I'm thinking of adding a BitArchiveReader::itemsMatching(...)
method that given a wildcard pattern, it will return a std::vector of the
items whose relative path within the archive match the pattern.
I hope to add such method in the next v4.0.9 or in the following v4.1-beta.
—
Reply to this email directly, view it on GitHub
<#253 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7K5B4Y75CE7SID4BC3IDLZ3PU3XAVCNFSM6AAAAABPXLOTLSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAOJTHA4DOOA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
If I know the relative path within the archive, for example
data/S123/2
, is there a way to get a list of the files within that directory?Beta Was this translation helpful? Give feedback.
All reactions