RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomLocateFileService.ImplGetTemplateStream Method

Provides the underlying implementation for the GetTemplateStream method.

Pascal
function ImplGetTemplateStream(AComponent: TComponent; AFileName: string; out AOwned: Boolean): TStream; virtual;
C++
virtual __fastcall TStream ImplGetTemplateStream(TComponent * AComponent, AnsiString AFileName, Boolean AOwned);

The GetTemplateStream method calls ImplGetTemplateStream to obtain a stream from which to read a specified template. ImplGetTemplateStream generates an OnFindStream event, and, if OnFindStream is unsuccessful, an OnFindTemplateFile event. If it gets a file name from the OnFindTemplateFile event handler, ImplGetTemplateStream calls the GetFileStream method to obtain a stream object from which to read the file. 

AComponent is the object that uses or is associated with the requested template. Typically, this is a content producer. 

AFileName is the logical name of the file to locate. 

AOwned indicates whether the caller should free the stream after reading the file contents. When AOwned returns true, the caller should free the stream object. When AOwned returns false, the caller should not free the stream object. 

GetTemplateStream returns a stream from which to read the requested file, or, if it could not locate the file, nil (Delphi) or NULL (C++). 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!