System.WideStrUtils.WStrNew

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function WStrNew(const Str: PWideChar): PWideChar;

C++

extern DELPHI_PACKAGE System::WideChar * __fastcall WStrNew(const System::WideChar * Str);

Properties

Type Visibility Source Unit Parent
function public
System.WideStrUtils.pas
System.WideStrUtils.hpp
System.WideStrUtils System.WideStrUtils

Description

Allocates space on and copies a PWideChar to the heap, returning a new PWideChar.

WStrNew allocates a copy of Str on the heap.

If Str is nil (Delphi) or NULL (C++) or points to an empty string, WStrNew returns a pointer to a new empty PWideChar.

Otherwise, WStrNew makes a duplicate of Str, obtaining space with a call to WStrAlloc, and returns a pointer to the duplicated PWideChar.

The allocated space is the length of Str * 2 + 5 bytes.

See Also