forked from 0ad/0ad
c_str() and _long=>size_t
This was SVN commit r169.
This commit is contained in:
parent
fa5870bad8
commit
12cea7849a
@ -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
|
||||
|
@ -38,7 +38,7 @@ More Info:
|
||||
#include <iostream>
|
||||
|
||||
#include "posix.h"
|
||||
#include "misc.h"
|
||||
#include "lib.h"
|
||||
#include "Network/Serialization.h"
|
||||
|
||||
#include <cstdlib>
|
||||
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user