mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r19477) -Fix (r1946x): removed a few too functions including the copy constructor
This commit is contained in:
parent
aab8849661
commit
f439b5767a
@ -74,6 +74,12 @@ public:
|
||||
/** default constructor - initializes empty blob */
|
||||
FORCEINLINE ByteBlob() { InitEmpty(); }
|
||||
|
||||
/** copy constructor */
|
||||
FORCEINLINE ByteBlob(const ByteBlob &src) {
|
||||
InitEmpty();
|
||||
AppendRaw(src);
|
||||
}
|
||||
|
||||
/** move constructor - take ownership of blob data */
|
||||
FORCEINLINE ByteBlob(BlobHeader * const & src)
|
||||
{
|
||||
@ -216,6 +222,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/** append bytes from given source blob to the end of existing data bytes - reallocates if necessary */
|
||||
FORCEINLINE void AppendRaw(const ByteBlob& src)
|
||||
{
|
||||
if (!src.IsEmpty()) {
|
||||
memcpy(Append(src.Length()), src.Begin(), src.Length());
|
||||
}
|
||||
}
|
||||
|
||||
/** Reallocate if there is no free space for num_bytes bytes.
|
||||
* @return pointer to the new data to be added */
|
||||
FORCEINLINE byte *Prepare(uint num_bytes)
|
||||
|
@ -56,6 +56,15 @@ struct CStrA : public CBlobT<char>
|
||||
}
|
||||
}
|
||||
|
||||
/** Append another CStrA. */
|
||||
FORCEINLINE void Append(const CStrA &src)
|
||||
{
|
||||
if (src.Length() > 0) {
|
||||
base::AppendRaw(src);
|
||||
base::FixTail();
|
||||
}
|
||||
}
|
||||
|
||||
/** Assignment from C string. */
|
||||
FORCEINLINE CStrA &operator = (const char *src)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user