mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 01:22:18 +03:00
Makes operator to use string_view
This commit is contained in:
@@ -27,10 +27,13 @@
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#include "modsecurity/string_view.hpp"
|
||||
#endif
|
||||
|
||||
#include "modsecurity/variable_value.h"
|
||||
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_ANCHORED_SET_VARIABLE_H_
|
||||
#define HEADERS_MODSECURITY_ANCHORED_SET_VARIABLE_H_
|
||||
|
||||
@@ -79,6 +82,12 @@ class AnchoredSetVariable : public std::unordered_multimap<std::string,
|
||||
void set(const std::string &key, const std::string &value,
|
||||
size_t offset);
|
||||
|
||||
void set(const std::string &key, const bpstd::string_view &value,
|
||||
size_t offset);
|
||||
|
||||
void set(const std::string &key, const char *value,
|
||||
size_t offset);
|
||||
|
||||
void set(const std::string &key, const std::string &value,
|
||||
size_t offset, size_t len);
|
||||
|
||||
|
||||
@@ -26,10 +26,14 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <cstring>
|
||||
|
||||
#include "modsecurity/string_view.hpp"
|
||||
#endif
|
||||
|
||||
#include "modsecurity/variable_value.h"
|
||||
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_ANCHORED_VARIABLE_H_
|
||||
#define HEADERS_MODSECURITY_ANCHORED_VARIABLE_H_
|
||||
|
||||
@@ -59,6 +63,8 @@ class AnchoredVariable {
|
||||
|
||||
void unset();
|
||||
void set(const std::string &a, size_t offset);
|
||||
void set(const bpstd::string_view &a, size_t offset);
|
||||
void set(const char *a, size_t offset);
|
||||
void set(const std::string &a, size_t offset, size_t offsetLen);
|
||||
void append(const std::string &a, size_t offset,
|
||||
bool spaceSeparator = false);
|
||||
|
||||
1422
headers/modsecurity/string_view.hpp
Normal file
1422
headers/modsecurity/string_view.hpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user