add gu_string_buf_data and gu_string_buf_length in libgu

This commit is contained in:
krasimir
2017-04-13 12:55:29 +00:00
parent 2551ab740b
commit df6c2f3f17
2 changed files with 20 additions and 0 deletions

View File

@@ -82,6 +82,20 @@ gu_string_buf_freeze(GuStringBuf* sb, GuPool* pool)
return p;
}
char*
gu_string_buf_data(GuStringBuf* sb)
{
gu_out_flush(sb->out, NULL);
return gu_buf_data(sb->buf);
}
size_t
gu_string_buf_length(GuStringBuf* sb)
{
gu_out_flush(sb->out, NULL);
return gu_buf_length(sb->buf);
}
void
gu_string_buf_flush(GuStringBuf* sb)
{

View File

@@ -33,6 +33,12 @@ gu_string_buf_out(GuStringBuf* sb);
GuString
gu_string_buf_freeze(GuStringBuf* sb, GuPool* pool);
char*
gu_string_buf_data(GuStringBuf* sb);
size_t
gu_string_buf_length(GuStringBuf* sb);
void
gu_string_buf_flush(GuStringBuf* sb);