System.Variants.TCustomVariantType.Copy

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

procedure Copy(var Dest: TVarData; const Source: TVarData;  const Indirect: Boolean); virtual; abstract;

C++

virtual void __fastcall Copy(TVarData &Dest, const TVarData &Source, const bool Indirect) = 0 ;

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Variants.pas
System.Variants.hpp
System.Variants TCustomVariantType

Description

Copies the data from a Variant of this custom type.

Override Copy to enable the custom Variant type to be copied (assigned) to another Variant.

Dest is the TVarData record from the Variant whose value is to be a copy of the source Variant.

Source is the TVarData record from a Variant of this custom type that is to be copied to Dest.

Indirect indicates whether the copy is direct or indirect. When Indirect is true, the source TVarData record contains an indirect reference to its data (the VarDataIsByRef method should return true for Source). When making an indirect copy, it is not necessary to reallocate records or objects, because the Variant does not "own" the data, it merely points to it. When making a direct copy, Copy must allocate new memory for any allocated records or objects, so that Dest can "own" its own copy of the data.

In TCustomVariantType, Copy is an abstract method. Descendant classes must override this method to provide an implementation.

See Also