Home Units Hierarchy Routines All identifiers

Class unaFileStream

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type unaFileStream = class(unaAbstractStream)

Description

This stream is stored in a file.

Hierarchy

Overview

Methods

Public constructor createStream(const fileName: wString; access: unsigned = GENERIC_READ + GENERIC_WRITE; shareMode: unsigned = FILE_SHARE_READ + FILE_SHARE_WRITE; loop: bool = false; fileFlags: unsigned = FILE_ATTRIBUTE_NORMAL);
Public destructor Destroy(); override;
Public function getPosition(): int; override;
Public function initStream(const fileName: wString; access: unsigned = GENERIC_READ + GENERIC_WRITE; shareMode: unsigned = FILE_SHARE_READ + FILE_SHARE_WRITE; loop: bool = false; fileFlags: unsigned = FILE_ATTRIBUTE_NORMAL): bool;
Public function seek(position: int; fromBeggining: bool = true): int; overload; override;
Public function seekD(delta: int): int; overload; override;
Protected function clear2(): unaAbstractStream; override;
Protected function getAvailableSize2(): int; override;
Protected function getSize2(): int; override;
Protected function read2(buf: pointer; size: int; remove: bool = true): int; override;
Protected function write2(buf: pointer; size: int): int; override;
Public procedure AfterConstruction(); override;
Public procedure close();

Properties

Public property fileName: wString read f_fileName;
Public property loop: bool read f_loop write f_loop;

Description

Methods

Public constructor createStream(const fileName: wString; access: unsigned = GENERIC_READ + GENERIC_WRITE; shareMode: unsigned = FILE_SHARE_READ + FILE_SHARE_WRITE; loop: bool = false; fileFlags: unsigned = FILE_ATTRIBUTE_NORMAL);
 
Public destructor Destroy(); override;
 
Public function getPosition(): int; override;
 
Public function initStream(const fileName: wString; access: unsigned = GENERIC_READ + GENERIC_WRITE; shareMode: unsigned = FILE_SHARE_READ + FILE_SHARE_WRITE; loop: bool = false; fileFlags: unsigned = FILE_ATTRIBUTE_NORMAL): bool;
 
Public function seek(position: int; fromBeggining: bool = true): int; overload; override;
 
Public function seekD(delta: int): int; overload; override;
 
Protected function clear2(): unaAbstractStream; override;
 
Protected function getAvailableSize2(): int; override;

Returns number of bytes you can read from the file from current position.

Protected function getSize2(): int; override;

Returns size of file.

Protected function read2(buf: pointer; size: int; remove: bool = true): int; override;
 
Protected function write2(buf: pointer; size: int): int; override;
 
Public procedure AfterConstruction(); override;
 
Public procedure close();
 

Properties

Public property fileName: wString read f_fileName;
 
Public property loop: bool read f_loop write f_loop;

When reading beyond the end of file, set this property is true, to wrap at 0 offset.

(c) 2012 Lake of Soft


Generated by PasDoc 0.12.1 on 2012-10-09