From 1492dd9b83366695c89dbbb333b8014bf816b228 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Mon, 4 Nov 2024 10:45:41 +0500 Subject: [PATCH] UI: Rename ConfConstData to ConfRoData --- src/ui/FortFirewallUI.pro | 4 ++-- src/ui/util/conf/confbuffer.cpp | 4 ++-- .../conf/{confconstdata.cpp => confrodata.cpp} | 14 +++++++------- src/ui/util/conf/{confconstdata.h => confrodata.h} | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) rename src/ui/util/conf/{confconstdata.cpp => confrodata.cpp} (78%) rename src/ui/util/conf/{confconstdata.h => confrodata.h} (74%) diff --git a/src/ui/FortFirewallUI.pro b/src/ui/FortFirewallUI.pro index b36b0779..3f0f9c86 100644 --- a/src/ui/FortFirewallUI.pro +++ b/src/ui/FortFirewallUI.pro @@ -191,8 +191,8 @@ SOURCES += \ util/conf/addressrange.cpp \ util/conf/appparseoptions.cpp \ util/conf/confbuffer.cpp \ - util/conf/confconstdata.cpp \ util/conf/confdata.cpp \ + util/conf/confrodata.cpp \ util/conf/confutil.cpp \ util/conf/ruletextparser.cpp \ util/dateutil.cpp \ @@ -426,8 +426,8 @@ HEADERS += \ util/conf/conf_types.h \ util/conf/confappswalker.h \ util/conf/confbuffer.h \ - util/conf/confconstdata.h \ util/conf/confdata.h \ + util/conf/confrodata.h \ util/conf/confruleswalker.h \ util/conf/confutil.h \ util/conf/ruletextparser.h \ diff --git a/src/ui/util/conf/confbuffer.cpp b/src/ui/util/conf/confbuffer.cpp index 379ee0e6..847e9c95 100644 --- a/src/ui/util/conf/confbuffer.cpp +++ b/src/ui/util/conf/confbuffer.cpp @@ -16,7 +16,7 @@ #include #include "confappswalker.h" -#include "confconstdata.h" +#include "confrodata.h" #include "confruleswalker.h" #include "confutil.h" #include "ruletextparser.h" @@ -349,7 +349,7 @@ bool ConfBuffer::loadZone(IpRange &ipRange) const char *data = buffer().data(); uint bufSize = buffer().size(); - return ConfConstData(data).loadAddressList(ipRange, bufSize); + return ConfRoData(data).loadAddressList(ipRange, bufSize); } bool ConfBuffer::parseAddressGroups(const QList &addressGroups, diff --git a/src/ui/util/conf/confconstdata.cpp b/src/ui/util/conf/confrodata.cpp similarity index 78% rename from src/ui/util/conf/confconstdata.cpp rename to src/ui/util/conf/confrodata.cpp index fcf9a226..3529db46 100644 --- a/src/ui/util/conf/confconstdata.cpp +++ b/src/ui/util/conf/confrodata.cpp @@ -1,16 +1,16 @@ -#include "confconstdata.h" +#include "confrodata.h" #include -ConfConstData::ConfConstData(const void *data) : m_data((const char *) data) { } +ConfRoData::ConfRoData(const void *data) : m_data((const char *) data) { } -bool ConfConstData::loadAddressList(IpRange &ipRange, uint &bufSize) +bool ConfRoData::loadAddressList(IpRange &ipRange, uint &bufSize) { return loadIpRange(ipRange, bufSize) && (bufSize == 0 || loadIpRange(ipRange, bufSize, /*isIPv6=*/true)); } -bool ConfConstData::loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6) +bool ConfRoData::loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6) { if (bufSize < FORT_CONF_ADDR_LIST_OFF) return false; @@ -48,17 +48,17 @@ bool ConfConstData::loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6) return true; } -void ConfConstData::loadLongs(longs_arr_t &array) +void ConfRoData::loadLongs(longs_arr_t &array) { loadData(array.data(), array.size(), sizeof(quint32)); } -void ConfConstData::loadIp6Array(ip6_arr_t &array) +void ConfRoData::loadIp6Array(ip6_arr_t &array) { loadData(array.data(), array.size(), sizeof(ip6_addr_t)); } -void ConfConstData::loadData(void *dst, int elemCount, uint elemSize) +void ConfRoData::loadData(void *dst, int elemCount, uint elemSize) { const size_t arraySize = size_t(elemCount) * elemSize; diff --git a/src/ui/util/conf/confconstdata.h b/src/ui/util/conf/confrodata.h similarity index 74% rename from src/ui/util/conf/confconstdata.h rename to src/ui/util/conf/confrodata.h index 2c56162f..6298b121 100644 --- a/src/ui/util/conf/confconstdata.h +++ b/src/ui/util/conf/confrodata.h @@ -1,5 +1,5 @@ -#ifndef CONFCONSTDATA_H -#define CONFCONSTDATA_H +#ifndef CONFRODATA_H +#define CONFRODATA_H #include @@ -7,10 +7,10 @@ #include "conf_types.h" -class ConfConstData +class ConfRoData { public: - explicit ConfConstData(const void *data); + explicit ConfRoData(const void *data); bool loadAddressList(IpRange &ipRange, uint &bufSize); bool loadIpRange(IpRange &ipRange, uint &bufSize, bool isIPv6 = false); @@ -23,4 +23,4 @@ private: const char *m_data = nullptr; }; -#endif // CONFCONSTDATA_H +#endif // CONFRODATA_H