RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ILocateFileService.GetTemplateStream Method

Returns a stream from which to read the contents of a requested file.

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

Call GetTemplateStream to access a file that the locate file service manages. The file does not need to be a file on disk, but may be a "logical" file whose content is stored using some other medium. 

AComponent is the component that will use the file or with which the file is associated. Typically, this is a content producer. 

AFileName is the name of the file to access. If the application uses more than one file with the same name, the locate file service uses the AComponent parameter to determine which file is appropriate. 

AOwned returns true if the caller should free that stream object after using it to access the file. 

GetTemplateStream returns a stream from which the caller can read the contents of the file. 

 

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