Core/String: Fix missing modifications

Former-commit-id: ac0e45fcc8caf8135542cb2fa6ab02b22182735a
This commit is contained in:
Lynix 2015-11-14 17:37:03 +01:00
parent 682b8811f5
commit b64ea6f534
2 changed files with 10 additions and 1 deletions

View File

@ -317,6 +317,7 @@ namespace Nz
{ {
inline SharedString(); inline SharedString();
inline SharedString(unsigned int strSize); inline SharedString(unsigned int strSize);
inline SharedString(unsigned int strSize, unsigned int strCapacity);
unsigned int capacity; unsigned int capacity;
unsigned int size; unsigned int size;

View File

@ -23,12 +23,20 @@ namespace Nz
} }
inline String::SharedString::SharedString(unsigned int strSize) : inline String::SharedString::SharedString(unsigned int strSize) :
capacity(strSize), capacity(strSize),
size(strSize), size(strSize),
string(new char[strSize + 1]) string(new char[strSize + 1])
{ {
string[strSize] = '\0'; string[strSize] = '\0';
} }
inline String::SharedString::SharedString(unsigned int strSize, unsigned int strCapacity) :
capacity(strCapacity),
size(strSize),
string(new char[strCapacity + 1])
{
string[strSize] = '\0';
}
} }
namespace std namespace std