System.SysUtils.TMarshaller.AllocStringAsAnsi

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function AllocStringAsAnsi(const Str: string): TPtrWrapper; overload;
function AllocStringAsAnsi(const Str: string; CodePage: Word): TPtrWrapper; overload;

Properties

Type Visibility Source Unit Parent
function public System.SysUtils.pas System.SysUtils TMarshaller

Description

Copies a string into a buffer.

The AllocStringAsAnsi method is overloaded:

  • The first overloaded function returns a wrapped pointer referencing a buffer containing a copy of Str encoded in the default multi-byte encoding, with a null terminator. The buffer will be freed when Flush is called or the record goes out of scope.
  • The second overloaded function returns a wrapped pointer referencing a buffer containing a copy of Str encoded in the multi-byte encoding specified by CodePage, with a null terminator. The buffer will be freed when Flush is called or the record goes out of scope.

See Also