mirror of https://github.com/libAthena/athena.git
Merge branch 'master' of https://github.com/libAthena/Athena
This commit is contained in:
commit
27d9fbcad4
include/Athena
|
@ -883,6 +883,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline std::string readWStringAsString(atInt32 fixedLen = -1)
|
inline std::string readWStringAsString(atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return std::string();
|
||||||
|
|
||||||
std::string retval;
|
std::string retval;
|
||||||
atUint16 chr = readUint16();
|
atUint16 chr = readUint16();
|
||||||
|
|
||||||
|
@ -921,6 +924,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline std::string readWStringAsStringLittle(atInt32 fixedLen = -1)
|
inline std::string readWStringAsStringLittle(atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return std::string();
|
||||||
|
|
||||||
std::string retval;
|
std::string retval;
|
||||||
atUint16 chr = readUint16Little();
|
atUint16 chr = readUint16Little();
|
||||||
|
|
||||||
|
@ -959,6 +965,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline std::string readWStringAsStringBig(atInt32 fixedLen = -1)
|
inline std::string readWStringAsStringBig(atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return std::string();
|
||||||
|
|
||||||
std::string retval;
|
std::string retval;
|
||||||
atUint16 chr = readUint16Big();
|
atUint16 chr = readUint16Big();
|
||||||
|
|
||||||
|
@ -996,6 +1005,8 @@ public:
|
||||||
*/
|
*/
|
||||||
inline std::string readString(atInt32 fixedLen = -1)
|
inline std::string readString(atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return std::string();
|
||||||
std::string ret;
|
std::string ret;
|
||||||
atUint8 chr = readByte();
|
atUint8 chr = readByte();
|
||||||
|
|
||||||
|
@ -1026,6 +1037,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline std::wstring readWString(atInt32 fixedLen = -1)
|
inline std::wstring readWString(atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return std::wstring();
|
||||||
|
|
||||||
std::wstring ret;
|
std::wstring ret;
|
||||||
atUint16 chr = readUint16();
|
atUint16 chr = readUint16();
|
||||||
|
|
||||||
|
@ -1057,6 +1071,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline std::wstring readWStringLittle(atInt32 fixedLen = -1)
|
inline std::wstring readWStringLittle(atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return std::wstring();
|
||||||
|
|
||||||
std::wstring ret;
|
std::wstring ret;
|
||||||
atUint16 chr = readUint16Little();
|
atUint16 chr = readUint16Little();
|
||||||
|
|
||||||
|
@ -1088,6 +1105,8 @@ public:
|
||||||
*/
|
*/
|
||||||
inline std::wstring readWStringBig(atInt32 fixedLen = -1)
|
inline std::wstring readWStringBig(atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return std::wstring();
|
||||||
std::wstring ret;
|
std::wstring ret;
|
||||||
atUint16 chr = readUint16Big();
|
atUint16 chr = readUint16Big();
|
||||||
|
|
||||||
|
|
|
@ -712,6 +712,8 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void writeStringAsWString(const std::string& str, atInt32 fixedLen = -1)
|
inline void writeStringAsWString(const std::string& str, atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return;
|
||||||
std::string tmpStr = "\xEF\xBB\xBF" + str;
|
std::string tmpStr = "\xEF\xBB\xBF" + str;
|
||||||
const utf8proc_uint8_t* buf = reinterpret_cast<const utf8proc_uint8_t*>(tmpStr.c_str());
|
const utf8proc_uint8_t* buf = reinterpret_cast<const utf8proc_uint8_t*>(tmpStr.c_str());
|
||||||
if (fixedLen < 0)
|
if (fixedLen < 0)
|
||||||
|
@ -768,6 +770,8 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void writeStringAsWStringLittle(const std::string& str, atInt32 fixedLen = -1)
|
inline void writeStringAsWStringLittle(const std::string& str, atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return;
|
||||||
std::string tmpStr = "\xEF\xBB\xBF" + str;
|
std::string tmpStr = "\xEF\xBB\xBF" + str;
|
||||||
const utf8proc_uint8_t* buf = reinterpret_cast<const utf8proc_uint8_t*>(tmpStr.c_str());
|
const utf8proc_uint8_t* buf = reinterpret_cast<const utf8proc_uint8_t*>(tmpStr.c_str());
|
||||||
if (fixedLen < 0)
|
if (fixedLen < 0)
|
||||||
|
@ -824,6 +828,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void writeStringAsWStringBig(const std::string& str, atInt32 fixedLen = -1)
|
inline void writeStringAsWStringBig(const std::string& str, atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
std::string tmpStr = "\xEF\xBB\xBF" + str;
|
std::string tmpStr = "\xEF\xBB\xBF" + str;
|
||||||
const utf8proc_uint8_t* buf = reinterpret_cast<const utf8proc_uint8_t*>(tmpStr.c_str());
|
const utf8proc_uint8_t* buf = reinterpret_cast<const utf8proc_uint8_t*>(tmpStr.c_str());
|
||||||
if (fixedLen < 0)
|
if (fixedLen < 0)
|
||||||
|
@ -877,6 +884,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void writeString(const std::string& str, atInt32 fixedLen = -1)
|
inline void writeString(const std::string& str, atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (fixedLen < 0)
|
if (fixedLen < 0)
|
||||||
{
|
{
|
||||||
for (atUint8 c : str)
|
for (atUint8 c : str)
|
||||||
|
@ -913,6 +923,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void writeWString(const std::wstring& str, atInt32 fixedLen = -1)
|
inline void writeWString(const std::wstring& str, atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (fixedLen < 0)
|
if (fixedLen < 0)
|
||||||
{
|
{
|
||||||
for (atUint16 c : str)
|
for (atUint16 c : str)
|
||||||
|
@ -949,6 +962,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void writeWStringLittle(const std::wstring& str, atInt32 fixedLen = -1)
|
inline void writeWStringLittle(const std::wstring& str, atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (fixedLen < 0)
|
if (fixedLen < 0)
|
||||||
{
|
{
|
||||||
for (atUint16 c : str)
|
for (atUint16 c : str)
|
||||||
|
@ -985,6 +1001,9 @@ public:
|
||||||
*/
|
*/
|
||||||
inline void writeWStringBig(const std::wstring& str, atInt32 fixedLen = -1)
|
inline void writeWStringBig(const std::wstring& str, atInt32 fixedLen = -1)
|
||||||
{
|
{
|
||||||
|
if (fixedLen == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (fixedLen < 0)
|
if (fixedLen < 0)
|
||||||
{
|
{
|
||||||
for (atUint16 c : str)
|
for (atUint16 c : str)
|
||||||
|
|
Loading…
Reference in New Issue