refactor: unglob std::wstring

This commit is contained in:
Tropical
2026-03-06 11:50:22 -06:00
parent 41db813a6d
commit cdc08700e4
581 changed files with 2156 additions and 2154 deletions
@@ -136,9 +136,9 @@ int BufferedReader::read(wchar_t cbuf[], unsigned int off, unsigned int len)
//or a carriage return followed immediately by a linefeed.
//Returns:
//A String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached
wstring BufferedReader::readLine()
std::wstring BufferedReader::readLine()
{
wstring output = L"";
std::wstring output = L"";
bool newLineCharFound = false;
while( readMark < bufferedMark )
+1 -1
View File
@@ -23,5 +23,5 @@ public:
virtual void close();
virtual int read();
virtual int read(wchar_t cbuf[], unsigned int off, unsigned int len);
wstring readLine();
std::wstring readLine();
};
+1 -1
View File
@@ -16,7 +16,7 @@ public:
virtual __int64 readLong() = 0;
virtual short readShort() = 0;
virtual wchar_t readChar() = 0;
virtual wstring readUTF() = 0;
virtual std::wstring readUTF() = 0;
virtual PlayerUID readPlayerUID() = 0; // 4J Added
virtual int skipBytes(int n) = 0;
};
@@ -354,9 +354,9 @@ short DataInputStream::readShort()
//
//Returns:
//a Unicode string.
wstring DataInputStream::readUTF()
std::wstring DataInputStream::readUTF()
{
wstring outputString;
std::wstring outputString;
if (stream == NULL)
{
app.DebugPrintf("DataInputStream::readUTF() but underlying stream is NULL\n");
+1 -1
View File
@@ -26,7 +26,7 @@ public:
virtual int readInt();
virtual __int64 readLong();
virtual short readShort();
virtual wstring readUTF();
virtual std::wstring readUTF();
void deleteChildStream();
virtual int readUTFChar();
virtual PlayerUID readPlayerUID(); // 4J Added
+2 -2
View File
@@ -14,7 +14,7 @@ public:
virtual void writeShort(short a) = 0;
virtual void writeBoolean(bool v) = 0;
virtual void writeChar(wchar_t v) = 0;
virtual void writeChars(const wstring& s) = 0;
virtual void writeUTF(const wstring& a) = 0;
virtual void writeChars(const std::wstring& s) = 0;
virtual void writeUTF(const std::wstring& a) = 0;
virtual void writePlayerUID(PlayerUID player) = 0; // 4J Added
};
@@ -159,7 +159,7 @@ void DataOutputStream::writeChar( wchar_t v )
//If no exception is thrown, the counter written is incremented by twice the length of s.
//Parameters:
//s - a String value to be written.
void DataOutputStream::writeChars(const wstring& str)
void DataOutputStream::writeChars(const std::wstring& str)
{
for( unsigned int i = 0; i < str.length(); i++)
{
@@ -189,7 +189,7 @@ void DataOutputStream::writeBoolean(bool b)
//This will be at least two plus the length of str, and at most two plus thrice the length of str.
//Parameters:
//str - a string to be written.
void DataOutputStream::writeUTF(const wstring& str)
void DataOutputStream::writeUTF(const std::wstring& str)
{
int strlen = (int)str.length();
int utflen = 0;
@@ -29,9 +29,9 @@ public:
virtual void writeLong(__int64 a);
virtual void writeShort(short a);
virtual void writeChar(wchar_t a);
virtual void writeChars(const wstring& a);
virtual void writeChars(const std::wstring& a);
virtual void writeBoolean(bool b);
virtual void writeUTF(const wstring& a);
virtual void writeUTF(const std::wstring& a);
virtual void writePlayerUID(PlayerUID player);
virtual void flush();
};
+1 -1
View File
@@ -3,7 +3,7 @@
#include "InputOutputStream.h"
#include "InputStream.h"
InputStream *InputStream::getResourceAsStream(const wstring &fileName)
InputStream *InputStream::getResourceAsStream(const std::wstring &fileName)
{
return new FileInputStream( File( fileName ) );
}
+1 -1
View File
@@ -13,5 +13,5 @@ public:
virtual void close() = 0;
virtual __int64 skip(__int64 n) = 0;
static InputStream *getResourceAsStream(const wstring &fileName);
static InputStream *getResourceAsStream(const std::wstring &fileName);
};