CAST II Game Engine

   MAIN       FEATURES       SCREENSHOTS       FORUMS       MANUAL       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TProperties

Unit

Props

Declaration

type TProperties = class

Description

Main properties class

Fields

 NameDescription
PublicChangedThis field becomes True with any change of properties or values
ProtectedFTotalPropertiesNumber of properties
ProtectedPropertiesSet of properties

Methods

Overview

Publicdestructor Destroy; override;
Publicfunction Add(const AName: AnsiString; const AValueType: Integer; const AOptions: TPOptions; const AValue, AEnumeration: AnsiString; const ADescription: AnsiString = ''): Integer;
Publicfunction AddBinary(const AName: AnsiString; const AOptions: TPOptions; AData: Pointer; DataSize: Integer): Integer;
Publicfunction AddEnumerated(const AName: AnsiString; const AOptions: TPOptions; AValue: Integer; const AEnumeration: AnsiString): Integer;
Publicprocedure AddSetProperty(const Name: AnsiString; Value, VisibleMembers: TSet32; ValuesEnum: TAnsiStringArray; const ADescription: AnsiString); overload;
Publicprocedure AddSetProperty(const Name: AnsiString; Value, VisibleMembers: TSet32; const ValuesEnum, ADescription: AnsiString); overload;
Publicprocedure Clear; virtual;
Publicprocedure DoForEach(Action: TPropertyDelegate; var CustomData: Integer);
Publicfunction Exists(const Name: AnsiString): Boolean;
Publicfunction FindAndFreeTemp(Data: Pointer): Boolean;
Publicfunction GetAsInteger(const Name: AnsiString): Integer; virtual;
Publicfunction GetAsXML: AnsiString; virtual;
Publicfunction GetBinPropertySize(const PropName: AnsiString; ElementSize: Integer): Integer;
Protectedfunction GetIndex(const Name: AnsiString): Integer; virtual;
Publicfunction GetNameByIndex(const Index: Integer): AnsiString; virtual;
Publicfunction GetOptions(const Name: AnsiString): TPOptions; virtual;
Publicfunction GetProperty(const Name: AnsiString): PProperty; virtual;
Protectedfunction GetPropertyByIndex(const Index: Integer): PProperty; virtual;
Publicfunction GetType(const Name: AnsiString): TPropertyValueType; virtual;
Publicfunction GetTypeAsString(Index: Integer): AnsiString; virtual;
Protectedfunction GetValue(const Name: AnsiString): AnsiString;
Protectedfunction GetValueByIndex(Index: Integer): AnsiString; virtual;
Publicfunction IsEqual(const Props: TProperties): Boolean;
Publicfunction IsEqualProperty(const Prop1, Prop2: TProperty): Boolean;
Publicprocedure Merge(const Props: TProperties; OverrideExisting: Boolean);
Publicfunction Read(Stream: TStream): Boolean; virtual;
Publicfunction RetrieveBinPropertyData(const PropName: AnsiString; Dest: Pointer): Integer;
Protectedprocedure SetEnumeratedValueByIndex(Index, ValueIndex: Integer);
Publicfunction SetSetProperty(const Name: AnsiString; var Res: TSet32; const ValuesEnum: AnsiString): Boolean; overload;
Publicfunction SetSetProperty(const Name: AnsiString; var Res: TSet32; ValuesEnum: TAnsiStringArray): Boolean; overload;
Protectedfunction SetValue(const Name, Value: AnsiString): Integer; virtual;
Protectedprocedure SetValueByIndex(Index: Integer; const Value: AnsiString);
Publicfunction TempCopy(Src: Pointer; Size: Integer): Pointer;
Publicfunction Valid(const Name: AnsiString): Boolean; virtual;
Protectedfunction ValueToFloat(const Value: AnsiString): Extended; virtual;
Protectedfunction ValueToInteger(ValueType: Integer; const Value, Enumeration: AnsiString): Int32; virtual;
Publicfunction Write(Stream: TStream): Boolean; virtual;

Description

Publicdestructor Destroy; override;

 

Publicfunction Add(const AName: AnsiString; const AValueType: Integer; const AOptions: TPOptions; const AValue, AEnumeration: AnsiString; const ADescription: AnsiString = ''): Integer;

Adds a new property to the set and returns its index

Publicfunction AddBinary(const AName: AnsiString; const AOptions: TPOptions; AData: Pointer; DataSize: Integer): Integer;

Adds a new binary property to the set and returns its index. AData should stay valid during the properties lifetime. if RetrieveBinPropertyData function is used to retrieve the data, no part of dynamic array or other managed memory can be passed in AData

Publicfunction AddEnumerated(const AName: AnsiString; const AOptions: TPOptions; AValue: Integer; const AEnumeration: AnsiString): Integer;

Adds a new enumerated property to the set and returns its index

Publicprocedure AddSetProperty(const Name: AnsiString; Value, VisibleMembers: TSet32; ValuesEnum: TAnsiStringArray; const ADescription: AnsiString); overload;

Adds a variable of a set type as a set of boolean values to the current property set.
VisibleMembers is a set of members which should be added. If it's empty all members will be added.

Publicprocedure AddSetProperty(const Name: AnsiString; Value, VisibleMembers: TSet32; const ValuesEnum, ADescription: AnsiString); overload;

Adds a variable of a set type as a set of boolean values to the current property set.
VisibleMembers is a set of members which should be added. If it's empty all members will be added.

Publicprocedure Clear; virtual;

Clear the current property set as well as temporal memory storage

Publicprocedure DoForEach(Action: TPropertyDelegate; var CustomData: Integer);

Calls the Action delegate for each property

Publicfunction Exists(const Name: AnsiString): Boolean;

Returns True if a property with the specified name exists in the set

Publicfunction FindAndFreeTemp(Data: Pointer): Boolean;

Finds and frees a previously created temporary memory buffer and returns True if it was found and freed

Publicfunction GetAsInteger(const Name: AnsiString): Integer; virtual;

Returns an integer representation of the properties value

Publicfunction GetAsXML: AnsiString; virtual;

Returns the properties in XML format

Publicfunction GetBinPropertySize(const PropName: AnsiString; ElementSize: Integer): Integer;

Returns size of the specified binary property in elements of the specified size

Protectedfunction GetIndex(const Name: AnsiString): Integer; virtual;

Returns the index of the specified property

Publicfunction GetNameByIndex(const Index: Integer): AnsiString; virtual;

Returns property name by its index

Publicfunction GetOptions(const Name: AnsiString): TPOptions; virtual;

Returns property option set

Publicfunction GetProperty(const Name: AnsiString): PProperty; virtual;

Returns a pointer to property by its name or nil if it is not found

Protectedfunction GetPropertyByIndex(const Index: Integer): PProperty; virtual;

Returns a pointer to the property data structure by property index

Publicfunction GetType(const Name: AnsiString): TPropertyValueType; virtual;

Returns property value type

Publicfunction GetTypeAsString(Index: Integer): AnsiString; virtual;

Returns property value type as string

Protectedfunction GetValue(const Name: AnsiString): AnsiString;

Returns the value of the specified property

Protectedfunction GetValueByIndex(Index: Integer): AnsiString; virtual;

Returns the value of the specified by index property

Publicfunction IsEqual(const Props: TProperties): Boolean;

Returns True if both property sets are equal

Publicfunction IsEqualProperty(const Prop1, Prop2: TProperty): Boolean;

Returns True if both properties are equal

Publicprocedure Merge(const Props: TProperties; OverrideExisting: Boolean);

Adds a properties set specified by Props to the current set. If OverrideExisting existing values will be overridden by the new ones

Publicfunction Read(Stream: TStream): Boolean; virtual;

Reads the properties from a stream and return True if success

Publicfunction RetrieveBinPropertyData(const PropName: AnsiString; Dest: Pointer): Integer;

Moves a binary property data to a previously allocated Dest and frees memory referenced by property value. Returns size of the binary property in elements or zero if no property or data found.

Protectedprocedure SetEnumeratedValueByIndex(Index, ValueIndex: Integer);

Sets the value index of the specified by index enumerated property

Publicfunction SetSetProperty(const Name: AnsiString; var Res: TSet32; const ValuesEnum: AnsiString): Boolean; overload;

Sets a set of boolean properties added by AddSetProperty with the specified set variable

Publicfunction SetSetProperty(const Name: AnsiString; var Res: TSet32; ValuesEnum: TAnsiStringArray): Boolean; overload;

Sets a set of boolean properties added by AddSetProperty with the specified set variable

Protectedfunction SetValue(const Name, Value: AnsiString): Integer; virtual;

Sets the value of the specified property

Protectedprocedure SetValueByIndex(Index: Integer; const Value: AnsiString);

Sets the value of the specified by index property

Publicfunction TempCopy(Src: Pointer; Size: Integer): Pointer;

Creates temporary copy of memory buffer or a new memory buffer if Src is nil and returns a pointer to the copy. The copy will be automatically destroyed when used by RetrieveBinPropertyData or while clearing or destroying TProperties instance. Should be used with binary properties to pass in AddBinary()-like methods.

Publicfunction Valid(const Name: AnsiString): Boolean; virtual;

Returns True if a property with the specified name exists and has a valid value

Protectedfunction ValueToFloat(const Value: AnsiString): Extended; virtual;

Returns a floating-point representation of the value with the specified type and enumeration

Protectedfunction ValueToInteger(ValueType: Integer; const Value, Enumeration: AnsiString): Int32; virtual;

Returns an integer representation of the value with the specified type and enumeration

Publicfunction Write(Stream: TStream): Boolean; virtual;

Writes the properties to a stream and return True if success

Properties

Overview

Publicproperty TotalProperties: Integer;
Publicproperty Values[const Name: AnsiString]: AnsiString;

Description

Publicproperty TotalProperties: Integer;

 

Publicproperty Values[const Name: AnsiString]: AnsiString;

Property values by names

Last modified: Jan 6, 2010
Copyright (C) 2006-2010, casteng.com