diff --git a/source/ps/CStr.cpp b/source/ps/CStr.cpp index c13a5f60d8..b0c78947cb 100755 --- a/source/ps/CStr.cpp +++ b/source/ps/CStr.cpp @@ -108,7 +108,7 @@ _double CStr::ToDouble() const } //You can retrieve the substring within the string -CStr CStr::GetSubstring(_long start, _long len) +CStr CStr::GetSubstring(size_t start, size_t len) { return CStr( m_String.substr(start, len) ); } @@ -398,9 +398,9 @@ ostream &operator<<(ostream &os, CStr &Str) return os; } -size_t CStr::GetSerializedLength() const +uint CStr::GetSerializedLength() const { - return m_String.length()+1; + return uint(m_String.length()+1); } u8 *CStr::Serialize(u8 *buffer) const diff --git a/source/ps/CStr.h b/source/ps/CStr.h index 9b8b09ca82..1a14308a78 100755 --- a/source/ps/CStr.h +++ b/source/ps/CStr.h @@ -38,7 +38,7 @@ More Info: #include #include "posix.h" -#include "misc.h" +#include "lib.h" #include "Network/Serialization.h" #include @@ -115,7 +115,7 @@ public: size_t Length() const {return m_String.length();} // Retrieves the substring within the string - CStr GetSubstring(_long start, _long len); + CStr GetSubstring(size_t start, size_t len); //Search the string for another string _long Find(const CStr &Str); @@ -172,8 +172,11 @@ public: TCHAR &operator[](_long n); TCHAR &operator[](_ulong n); + inline const char *c_str() + { return m_String.c_str(); } + // Serialization functions - virtual size_t GetSerializedLength() const; + virtual uint GetSerializedLength() const; virtual u8 *Serialize(u8 *buffer) const; virtual const u8 *Deserialize(const u8 *buffer, const u8 *bufferend);