Added a function to dump some debug details about the TString.
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
#include "tstring.h"
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int GetGlyphByteWidth(const char* glyph);
|
||||
void TStringCopyGlyph(const char* glyph, int length, TString* string);
|
||||
@@ -140,4 +137,12 @@ void TStringCopyGlyph(const char* glyph, int length, TString* string) {
|
||||
|
||||
string->ByteCount += length;
|
||||
string->Length++;
|
||||
}
|
||||
|
||||
void TStringPrintDetails(const TString* string) {
|
||||
if (!string) return;
|
||||
|
||||
printf("Length: %d Size: %d byte(s) Capacity: %d bytes\n", string->Length, string->ByteCount, string->Capacity);
|
||||
printf("%s", TStringGetString(string));
|
||||
printf("\n");
|
||||
}
|
||||
Reference in New Issue
Block a user