Method FastBuffer-1.GetString
Overload
Gets API result as string, or allocates bigger buffer if old buffer was too small. This function can be used when T is char.
public bool GetString(int r, out string s, BSFlags flags = 0, string sDefault = null)
Parameters
r (int)
The return value of the called Windows API function, if it returns string length or required buffer length. Or you can call FastBuffer<T>.FindStringLength. |
s (string)
Receives the result string if succeeded, else sDefault (default |
flags (BSFlags)
Use if the API function isn't like this:
|
sDefault (string)
Set s = this string if buffer too small or r < 1 or if the retrieved string == this string (avoid creating new string). |
Returns
bool
If r > n, calls |