UI: Rename ConfConstData to ConfRoData

This commit is contained in:
Nodir Temirkhodjaev 2024-11-04 10:45:41 +05:00
parent 53488c1b4f
commit 1492dd9b83
4 changed files with 16 additions and 16 deletions

View File

@ -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 \

View File

@ -16,7 +16,7 @@
#include <util/stringutil.h>
#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<AddressGroup *> &addressGroups,

View File

@ -1,16 +1,16 @@
#include "confconstdata.h"
#include "confrodata.h"
#include <common/fortconf.h>
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;

View File

@ -1,5 +1,5 @@
#ifndef CONFCONSTDATA_H
#define CONFCONSTDATA_H
#ifndef CONFRODATA_H
#define CONFRODATA_H
#include <QObject>
@ -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