Share

AcString::getBuffer

C++

wchar_t * getBuffer(
    Adesk::Int32 nMinBufferLength = 0
);

Description

Returns a pointer to the internal character buffer of the string object, allowing direct access to and modification of the string contents. The returned buffer contains the entire string contents and is null terminated.

The buffer is at least large enough to hold nMinBufferLength characters plus a null terminator. If nNumBufferLength is smaller than the length of the string, it is ignored and the entire string is available. If it is larger than string length, a larger buffer is allocated and you are able to modify that many characters and may grow the string.

Clients should call releaseBuffer() when they're done accessing the buffer, and they should not call any other methods (except an implicit call to the dtor) before then. But it's okay if the string is destroyed without releaseBuffer() having been called.

Parameters

Parameters Description
nMinBufferLength Input number of characters that should fit in the buffer, not including the null terminator. 0 or negative number results in using the current string size.

Returns

wchar_t pointer to the AcString's (null-terminated) character buffer.

Links

AcString

Previous Declaration

AutoCAD 2017 through AutoCAD 2024

ACBASE_PORT ACHAR* getBuffer(int nMinBufferLength = 0);

History

AutoCAD 2025

nMinBufferLength argument now expects an Adesk::Int32 instead of int.

Was this information helpful?