Added String::Combine.
It was previously commented out because it was broken.
This commit is contained in:
parent
bd489eb73a
commit
795b1ef4fd
|
@ -333,7 +333,7 @@ namespace Maxsi
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
char* Combine(size_t NumParameters, ...)
|
char* Combine(size_t NumParameters, ...)
|
||||||
{
|
{
|
||||||
va_list param_pt;
|
va_list param_pt;
|
||||||
|
@ -348,11 +348,12 @@ namespace Maxsi
|
||||||
{
|
{
|
||||||
TMP = va_arg(param_pt, const char*);
|
TMP = va_arg(param_pt, const char*);
|
||||||
|
|
||||||
if ( TMP != NULL ) { ResultLength += strlen(TMP); }
|
if ( TMP != NULL ) { ResultLength += Length(TMP); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate a string with the desired length.
|
// Allocate a string with the desired length.
|
||||||
char* Result = new char[ResultLength+1];
|
char* Result = new char[ResultLength+1];
|
||||||
|
if ( !Result ) { return NULL; }
|
||||||
|
|
||||||
Result[0] = 0;
|
Result[0] = 0;
|
||||||
|
|
||||||
|
@ -367,8 +368,8 @@ namespace Maxsi
|
||||||
|
|
||||||
if ( TMP )
|
if ( TMP )
|
||||||
{
|
{
|
||||||
size_t TMPLength = strlen(TMP);
|
size_t TMPLength = Length(TMP);
|
||||||
strcpy(Result + ResultOffset, TMP);
|
Copy(Result + ResultOffset, TMP);
|
||||||
ResultOffset += TMPLength;
|
ResultOffset += TMPLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue