mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Replaced string parameters with string_view in AuditLog
This commit is contained in:
parent
2ee45de2fc
commit
31fb9390c2
@ -153,18 +153,18 @@ class AuditLog {
|
|||||||
bool setStorageDirMode(int permission);
|
bool setStorageDirMode(int permission);
|
||||||
bool setFileMode(int permission);
|
bool setFileMode(int permission);
|
||||||
bool setStatus(AuditLogStatus new_status);
|
bool setStatus(AuditLogStatus new_status);
|
||||||
bool setRelevantStatus(const std::basic_string<char>& new_relevant_status);
|
bool setRelevantStatus(std::string_view new_relevant_status);
|
||||||
bool setFilePath1(const std::basic_string<char>& path);
|
bool setFilePath1(std::string_view path);
|
||||||
bool setFilePath2(const std::basic_string<char>& path);
|
bool setFilePath2(std::string_view path);
|
||||||
bool setStorageDir(const std::basic_string<char>& path);
|
bool setStorageDir(std::string_view path);
|
||||||
bool setHeader(const std::basic_string<char>& header);
|
bool setHeader(std::string_view header);
|
||||||
bool setFormat(AuditLogFormat fmt);
|
bool setFormat(AuditLogFormat fmt);
|
||||||
|
|
||||||
int getDirectoryPermission() const;
|
int getDirectoryPermission() const;
|
||||||
int getFilePermission() const;
|
int getFilePermission() const;
|
||||||
int getParts() const;
|
int getParts() const;
|
||||||
|
|
||||||
bool setParts(const std::basic_string<char>& new_parts);
|
bool setParts(std::string_view new_parts);
|
||||||
bool setType(AuditLogType audit_type);
|
bool setType(AuditLogType audit_type);
|
||||||
|
|
||||||
bool init(std::string *error);
|
bool init(std::string *error);
|
||||||
@ -174,8 +174,8 @@ class AuditLog {
|
|||||||
bool saveIfRelevant(Transaction *transaction, int parts);
|
bool saveIfRelevant(Transaction *transaction, int parts);
|
||||||
bool isRelevant(int status);
|
bool isRelevant(int status);
|
||||||
|
|
||||||
static int addParts(int parts, const std::string& new_parts);
|
static int addParts(int parts, std::string_view new_parts);
|
||||||
static int removeParts(int parts, const std::string& new_parts);
|
static int removeParts(int parts, std::string_view new_parts);
|
||||||
|
|
||||||
void setCtlAuditEngineActive() {
|
void setCtlAuditEngineActive() {
|
||||||
m_ctlAuditEngineActive = true;
|
m_ctlAuditEngineActive = true;
|
||||||
|
@ -109,31 +109,31 @@ bool AuditLog::setStatus(AuditLogStatus status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AuditLog::setRelevantStatus(const std::basic_string<char>& status) {
|
bool AuditLog::setRelevantStatus(std::string_view status) {
|
||||||
this->m_relevant = std::string(status);
|
this->m_relevant = std::string(status);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AuditLog::setStorageDir(const std::basic_string<char>& path) {
|
bool AuditLog::setStorageDir(std::string_view path) {
|
||||||
this->m_storage_dir = path;
|
this->m_storage_dir = path;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AuditLog::setFilePath1(const std::basic_string<char>& path) {
|
bool AuditLog::setFilePath1(std::string_view path) {
|
||||||
this->m_path1 = path;
|
this->m_path1 = path;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AuditLog::setFilePath2(const std::basic_string<char>& path) {
|
bool AuditLog::setFilePath2(std::string_view path) {
|
||||||
this->m_path2 = path;
|
this->m_path2 = path;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AuditLog::setHeader(const std::basic_string<char>& header) {
|
bool AuditLog::setHeader(std::string_view header) {
|
||||||
this->m_header = header;
|
this->m_header = header;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ bool AuditLog::setFormat(AuditLogFormat fmt) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AuditLog::addParts(int parts, const std::string& new_parts) {
|
int AuditLog::addParts(int parts, std::string_view new_parts) {
|
||||||
PARTS_CONSTAINS('A', AAuditLogPart)
|
PARTS_CONSTAINS('A', AAuditLogPart)
|
||||||
PARTS_CONSTAINS('B', BAuditLogPart)
|
PARTS_CONSTAINS('B', BAuditLogPart)
|
||||||
PARTS_CONSTAINS('C', CAuditLogPart)
|
PARTS_CONSTAINS('C', CAuditLogPart)
|
||||||
@ -162,7 +162,7 @@ int AuditLog::addParts(int parts, const std::string& new_parts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int AuditLog::removeParts(int parts, const std::string& new_parts) {
|
int AuditLog::removeParts(int parts, std::string_view new_parts) {
|
||||||
PARTS_CONSTAINS_REM('A', AAuditLogPart)
|
PARTS_CONSTAINS_REM('A', AAuditLogPart)
|
||||||
PARTS_CONSTAINS_REM('B', BAuditLogPart)
|
PARTS_CONSTAINS_REM('B', BAuditLogPart)
|
||||||
PARTS_CONSTAINS_REM('C', CAuditLogPart)
|
PARTS_CONSTAINS_REM('C', CAuditLogPart)
|
||||||
@ -180,7 +180,7 @@ int AuditLog::removeParts(int parts, const std::string& new_parts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AuditLog::setParts(const std::basic_string<char>& new_parts) {
|
bool AuditLog::setParts(std::string_view new_parts) {
|
||||||
int parts = 0;
|
int parts = 0;
|
||||||
|
|
||||||
PARTS_CONSTAINS('A', AAuditLogPart)
|
PARTS_CONSTAINS('A', AAuditLogPart)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user