|
From: <cn...@us...> - 2020-10-25 23:55:49
|
Revision: 1070
http://sourceforge.net/p/seq/svn/1070
Author: cn187
Date: 2020-10-25 23:55:46 +0000 (Sun, 25 Oct 2020)
Log Message:
-----------
Replace Q3CString with QByteArray and QString
Modified Paths:
--------------
showeq/branches/pre_6_0_beta/src/eqstr.cpp
showeq/branches/pre_6_0_beta/src/mapcore.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.cpp
showeq/branches/pre_6_0_beta/src/packetinfo.h
showeq/branches/pre_6_0_beta/src/packetstream.cpp
showeq/branches/pre_6_0_beta/src/spells.cpp
Modified: showeq/branches/pre_6_0_beta/src/eqstr.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/eqstr.cpp 2020-10-25 23:55:40 UTC (rev 1069)
+++ showeq/branches/pre_6_0_beta/src/eqstr.cpp 2020-10-25 23:55:46 UTC (rev 1070)
@@ -32,7 +32,7 @@
#include <QFile>
#include <QStringList>
#include <Q3ValueVector>
-#include <Q3CString>
+#include <QString>
EQStr::EQStr()
: m_messageStrings(),
@@ -61,11 +61,11 @@
return false;
}
- // allocate a QCString large enough to hold the entire file
- Q3CString textData(formatFile.size() + 1);
-
+ // allocate a QByteArray large enough to hold the entire file
+ QByteArray textData(formatFile.size() + 1, '\0');
+
// read in the entire file
- formatFile.readBlock(textData.data(), textData.size());
+ formatFile.read(textData.data(), textData.size());
// construct a regex to deal with either style line termination
QRegExp lineTerm("[\r\n]{1,2}");
Modified: showeq/branches/pre_6_0_beta/src/mapcore.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/mapcore.cpp 2020-10-25 23:55:40 UTC (rev 1069)
+++ showeq/branches/pre_6_0_beta/src/mapcore.cpp 2020-10-25 23:55:46 UTC (rev 1070)
@@ -44,7 +44,7 @@
#include <QFile>
#include <QRegExp>
#include <Q3PointArray>
-#include <Q3CString>
+#include <QByteArray>
#include <QPixmap>
//----------------------------------------------------------------------
@@ -514,11 +514,11 @@
// note the file name
m_fileName = filename;
- // allocate memory in a QCString to hold the entire file contents
- Q3CString textData(mapFile.size() + 1);
+ // allocate memory in a QByteArray to hold the entire file contents
+ QByteArray textData(mapFile.size() + 1, '\0');
// read the file as one big chunk
- mapFile.readBlock(textData.data(), textData.size());
+ mapFile.read(textData.data(), textData.size());
// construct a regex to deal with either style line termination
QRegExp lineTerm("[\r\n]{1,2}");
@@ -958,13 +958,13 @@
// note the file name
m_fileName = filename;
-
- // allocate memory in a QCString to hold the entire file contents
- Q3CString textData(mapFile.size() + 1);
-
+
+ // allocate memory in a QByteArray to hold the entire file contents
+ QByteArray textData(mapFile.size() + 1, '\0');
+
// read the file as one big chunk
- mapFile.readBlock(textData.data(), textData.size());
-
+ mapFile.read(textData.data(), textData.size());
+
// construct a regex to deal with either style line termination
QRegExp lineTerm("[\r\n]{1,2}");
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-10-25 23:55:40 UTC (rev 1069)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.cpp 2020-10-25 23:55:46 UTC (rev 1070)
@@ -29,7 +29,7 @@
#include <QFile>
#include <QXmlAttributes>
#include <Q3TextStream>
-#include <Q3CString>
+#include <QByteArray>
#include <map>
@@ -355,7 +355,7 @@
}
OrderedMap::iterator oit;
- Q3CString opcodeString(256);
+ QString opcodeString;
static const char* dirStrs[] = { "client", "server", "both", };
static const char* sztStrs[] = { "none", "match", "modulus", };
@@ -383,8 +383,8 @@
cit != comments.end(); ++cit)
out << indent << "<comment>" << *cit << "</comment>" << endl;
- Q3CString dirStr;
- Q3CString sztStr;
+ QByteArray dirStr;
+ QByteArray sztStr;
// iterate over the payloads
QListIterator<EQPacketPayload*> pit(*currentOPCode);
Modified: showeq/branches/pre_6_0_beta/src/packetinfo.h
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetinfo.h 2020-10-25 23:55:40 UTC (rev 1069)
+++ showeq/branches/pre_6_0_beta/src/packetinfo.h 2020-10-25 23:55:46 UTC (rev 1070)
@@ -31,7 +31,7 @@
#include <QList>
#include <QHash>
#include <QByteArray>
-#include <Q3CString>
+#include <QString>
#include <QStringList>
#include <Q3TextStream>
@@ -102,8 +102,8 @@
public:
EQPacketPayload();
~EQPacketPayload();
-
- const Q3CString& typeName() const;
+
+ const QString& typeName() const;
bool setType(const EQPacketTypeDB& db, const char* typeName);
size_t typeSize() const;
EQSizeCheckType sizeCheckType() const;
@@ -114,7 +114,7 @@
bool match(const uint8_t* data, size_t size, uint8_t dir) const;
protected:
- Q3CString m_typeName;
+ QString m_typeName;
size_t m_typeSize;
EQSizeCheckType m_sizeCheckType;
uint8_t m_dir;
@@ -124,7 +124,7 @@
typedef QList<EQPacketPayload*> EQPayloadList;
typedef QListIterator<EQPacketPayload*> EQPayloadListIterator;
-inline const Q3CString& EQPacketPayload::typeName() const
+inline const QString& EQPacketPayload::typeName() const
{
return m_typeName;
}
Modified: showeq/branches/pre_6_0_beta/src/packetstream.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-10-25 23:55:40 UTC (rev 1069)
+++ showeq/branches/pre_6_0_beta/src/packetstream.cpp 2020-10-25 23:55:46 UTC (rev 1070)
@@ -28,7 +28,7 @@
#include "diagnosticmessages.h"
#include <cstdio>
-#include <Q3CString>
+#include <QString>
//----------------------------------------------------------------------
// Macros
@@ -159,7 +159,7 @@
if (!dispatch)
{
// construct a name for the dispatch
- Q3CString dispatchName(256);
+ QString dispatchName(256, '\0');
dispatchName.sprintf("PacketDispatch:%s:%s:%d:%s:%d",
(const char*)name(), (const char*)opcodeName,
payload->dir(), (const char*)payload->typeName(),
@@ -475,10 +475,10 @@
{
if (payload->sizeCheckType() == SZC_Match)
tempStr += QString(" sizeof(%1):%2")
- .arg(payload->typeName().data()).arg(payload->typeSize());
+ .arg(payload->typeName()).arg(payload->typeSize());
else if (payload->sizeCheckType() == SZC_Modulus)
tempStr += QString(" modulus of sizeof(%1):%2")
- .arg(payload->typeName().data()).arg(payload->typeSize());
+ .arg(payload->typeName()).arg(payload->typeSize());
}
}
Modified: showeq/branches/pre_6_0_beta/src/spells.cpp
===================================================================
--- showeq/branches/pre_6_0_beta/src/spells.cpp 2020-10-25 23:55:40 UTC (rev 1069)
+++ showeq/branches/pre_6_0_beta/src/spells.cpp 2020-10-25 23:55:46 UTC (rev 1070)
@@ -38,7 +38,7 @@
#include <QFile>
#include <QQueue>
#include <QRegExp>
-#include <Q3CString>
+#include <QByteArray>
static inline int16_t min(const int16_t& __a, const int16_t& __b)
{
@@ -261,11 +261,11 @@
// Queue to temporarily store our Spells until we know the maxSpell
QQueue<Spell*> spellQueue;
- // allocate memory in a QCString to hold the entire file contents
- Q3CString textData(spellsFile.size() + 1);
+ // allocate memory in a QByteArray to hold the entire file contents
+ QByteArray textData(spellsFile.size() + 1, '\0');
// read the file as one big chunk
- spellsFile.readBlock(textData.data(), textData.size());
+ spellsFile.read(textData.data(), textData.size());
// construct a regex to deal with either style line termination
QRegExp lineTerm("[\r\n]{1,2}");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|