summaryrefslogtreecommitdiff
path: root/apt-pkg/cachefilter-patterns.h
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2024-11-14 14:54:40 +0000
committerJulian Andres Klode <jak@debian.org>2024-11-14 14:54:40 +0000
commit82752f6e0c65541244c2607e5dedf437701e07dc (patch)
tree9f8a63e33e05350551919c0c6f66340820303120 /apt-pkg/cachefilter-patterns.h
parent8f10ee850db3892bc979694864451be3a73ad1e8 (diff)
parent36998f582e211f745799ddc2a8bc286541e56689 (diff)
Merge branch 'svequiv' into 'main'
Internally replace APT::StringView with std::string_view where it doesn't affect the ABI, with implementations that support both std::string_view and APT::StringView with new shims. ReportMirrorFailureToCentral: fix use-after-free See merge request apt-team/apt!394
Diffstat (limited to 'apt-pkg/cachefilter-patterns.h')
-rw-r--r--apt-pkg/cachefilter-patterns.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/apt-pkg/cachefilter-patterns.h b/apt-pkg/cachefilter-patterns.h
index 1f2f4f781..a45b9afcf 100644
--- a/apt-pkg/cachefilter-patterns.h
+++ b/apt-pkg/cachefilter-patterns.h
@@ -12,7 +12,6 @@
#include <apt-pkg/cachefilter.h>
#include <apt-pkg/error.h>
#include <apt-pkg/header-is-private.h>
-#include <apt-pkg/string_view.h>
#include <apt-pkg/strutl.h>
#include <cassert>
#include <iostream>
@@ -59,17 +58,17 @@ struct APT_PUBLIC PatternTreeParser
struct PatternNode : public Node
{
- APT::StringView term;
+ std::string_view term;
std::vector<std::unique_ptr<Node>> arguments;
bool haveArgumentList = false;
APT_HIDDEN std::ostream &render(std::ostream &stream) override;
- APT_HIDDEN bool matches(APT::StringView name, int min, int max);
+ APT_HIDDEN bool matches(std::string_view name, int min, int max);
};
struct WordNode : public Node
{
- APT::StringView word;
+ std::string_view word;
bool quoted = false;
APT_HIDDEN std::ostream &render(std::ostream &stream) override;
};
@@ -79,10 +78,10 @@ struct APT_PUBLIC PatternTreeParser
size_t offset = 0;
};
- APT::StringView sentence;
+ std::string_view sentence;
State state;
- PatternTreeParser(APT::StringView sentence) : sentence(sentence){};
+ PatternTreeParser(std::string_view sentence) : sentence(sentence){};
off_t skipSpace()
{
while (sentence[state.offset] == ' ' || sentence[state.offset] == '\t' || sentence[state.offset] == '\r' || sentence[state.offset] == '\n')