System.WideStrUtils.WStrNew

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

function WStrNew(const Str: PWideChar): PWideChar;

C++

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

Propriétés

Type Visibilité  Source Unité  Parent
function public
System.WideStrUtils.pas
System.WideStrUtils.hpp
System.WideStrUtils System.WideStrUtils

Description

Alloue de l'espace et copie un PWideChar sur le tas, en renvoyant un nouveau PWideChar.

WStrNew alloue une copie de Str sur le tas.

Si Str est à nil (Delphi) ou NULL (C++) ou pointe sur une chaîne vide, WStrNew renvoie un pointeur sur un nouveau PWideChar vide.

Sinon, WStrNew duplique Str en récupérant l'espace nécessaire par un appel à WStrAlloc, et renvoie un pointeur sur le PWideChar dupliqué.

L'espace alloué est la longueur de Str * 2 + 5 octets.

Voir aussi