Indy 9
TIpProperty
Hierarchy, Properties, Methods, See Also, Unit: IdNetworkCalculator
Provides persistent storage and manipulation for network address and mask values.
TIpProperty = class(TPersistent)
Unit
IdNetworkCalculator
Description
TIpProperty is a TPersistent descendant that provides storage variables and manipulation methods for the components of a network address or network mask. TIpProperty is used by TIdNetworkCalculator to represent the NetworkAddress and NetworkMask properties.

Use Byte1, Byte2, Byte3, and Byte4 to access the individual Byte values of the 32-bit IP address.

Use AsDoubleWord to access the LongWord value of the IP address.

Use AsBinaryString to access the String representation of individual bits of the IP address. For example: "11111111111111111111111100000000" is the binary string representation of the network mask 255.255.255.0.

Use AsString to access the String representation of the IP address. For example: "255.255.255.0" is the string representation of a network mask with the "dotted-decimal" value 255.255.255.0.

Use SetAll to simultaneously update the 4 Byte values in the IP address.

Use ByteArray to access the Byte values of the IP address and indicate if the byte has a zero or non-zero value.

Use the OnChange event handler to perform application-specific processing when the value of the TIpProperty has been modified.


TIpProperty.AddressType
TIpProperty, See Also
Represents the address class type for an IP address.
property AddressType: TIdIPAddressType;
Description
AddressType is a read-only TIdIPAddressType property that represents the class type for an IP address. AddressType can be used to determine if an IP address is a routable non-private address, or a loopback address.

TIpProperty.AsBinaryString
TIpProperty, See Also, Example
Represents a string containing the individual bits in the 32-bit IP address.
property AsBinaryString: String;
Description
AsBinaryString is a String property that represents the individual bits in the 32-bit IP address or network mask. "1" indicates that the bit set. "0" indicates that the bit is not set. AsBinaryString should always contain a string with a length of 32 characters. For example, the network mask 255.255.255.0 would be represent by AsBinaryString in the form "11111111111111111111111100000000".

AsBinaryString calls SetAll to update the value of the individual bytes in the IP address.

Use Byte1, Byte2, Byte3, Byte4, AsDoubleWord, or AsString to access the value of the IP address in other representations.


TIpProperty.AsDoubleWord
TIpProperty, See Also, Example
Represents the IP address as a unsigned integer value.
property AsDoubleWord: Longword;
Description
AsDoubleWord is a LongWord property that represents the IP address or network mask as a unsigned integer value. AsDoubleWord calls SetAll to update the value of the individual bytes in the IP address.

Use Byte1, Byte2, Byte3, Byte4, AsBinaryString, or AsString to access the value of the IP address in other representations.


TIpProperty.AsString
TIpProperty, See Also, Example
Represents the IP address as a string in dotted-decimal format.
property AsString: String;
Description
AsString is a String property that represents the value of the IP address or network mask in dotted-decimal format, like "129.71.2.4".

AsString calls SetAll to update the value of the individual bytes in the IP address.

Use Byte1, Byte2, Byte3, Byte4, AsDoubleWord, or AsBinaryString to access the value of the IP address in other representations.


TIpProperty.Byte1
TIpProperty, See Also
Represents one byte of the 4-byte IP address or network mask.
property Byte1: byte;
Description
Byte1 is a Byte property that represents one Byte of the 4-byte IP address or network mask.

Byte1, Byte2, Byte3, and Byte4 are used primarily to read the current value of the TIpProperty. Byte1 calls SetAll to update the value of the byte in the IP address.

Use AsDoubleWord, AsString, or AsBinaryString to access the value of the IP address in other representations.


TIpProperty.Byte2
TIpProperty, See Also
Represents one byte of the 4-byte IP address or network mask.
property Byte2: Byte;
Description
Byte2 is a Byte property that represents one Byte of the 4-byte IP address or network mask.

Byte1, Byte2, Byte3, and Byte4 are used primarily to read the current value of the TIpProperty. Byte2 calls SetAll to update the value of the byte in the IP address.

Use AsDoubleWord, AsString, or AsBinaryString to access the value of the IP address in other representations.


TIpProperty.Byte3
TIpProperty, See Also
Represents one byte of the 4-byte IP address or network mask.
property Byte3: Byte;
Description
Byte3 is a Byte property that represents one Byte of the 4-byte IP address or network mask.

Byte1, Byte2, Byte3, and Byte4 are used primarily to read the current value of the TIpProperty. Byte3 calls SetAll to update the value of the byte in the IP address.

Use AsDoubleWord, AsString, or AsBinaryString to access the value of the IP address in other representations.


TIpProperty.Byte4
TIpProperty, See Also
Represents one byte of the 4-byte IP address or network mask.
property Byte4: Byte;
Description
Byte4 is a Byte property that represents one Byte of the 4-byte IP address or network mask.

Byte1, Byte2, Byte3, and Byte4 are used primarily to read the current value of the TIpProperty. Byte4 calls SetAll to update the value of the byte in the IP address.

Use AsDoubleWord, AsString, or AsBinaryString to access the value of the IP address in other representations.


TIpProperty.ByteArray
TIpProperty, See Also
Represents the 32-bit IP address as boolean flags.
property ByteArray [Index: cardinal]: boolean;
Parameters
Index
Position in the ByteArray.
Return Value
Boolean - True if the bit set.
Description
ByteArray is an indexed Boolean property that provides access to the individual bits that make up the 32-bit IP address or network mask. Values for Index are in the range 0..31. ByteArray is used primary in the construction of the AsBinaryString representation of the IP address.

Use Byte1, Byte2, Byte3, Byte4, AsDoubleWord, AsString, or AsBinaryString to access the value of the IP address in other representations.


TIpProperty.OnChange
TIpProperty, See Also
Specifies the event handler for changes to the IP address value.
property OnChange: TNotifyEvent;
Description
OnChange is a TNotifyEvent property that specifies the event handler for changes to the value of the IP address or network mask. OnChange is triggered from both Assign and SetAll.

Use OnChange to notify an application of changes in the network address properties. Assign an OnChange event handler to respond to the event notification.


TIpProperty.Assign
TIpProperty, See Also, Example
Copies the contents of another TIpProperty object.
procedure Assign(Source: Tpersistent); override;
Parameters
Source: Tpersistent
The persistent object that is the source of the object values.
Description
Assign is an overridden procedure inherited from TPersistent that copies the properties or other attributes of Source to the current instance.

Assign calls SetAll to update the Byte values of the IP address or network mask. Assigns triggers the OnChange event handler to signify that a change has occurred in TIpProperty values. Finally, Assign calls the inherited Assign method to handle assignment of properties from the class of the Source parameter.


TIpProperty.SetAll
TIpProperty, See Also
Updates the byte values of the 32-bit IP address.
procedure SetAll(One: Byte; Two: Byte; Three: Byte; Four: Byte); virtual;
Parameters
One: Byte
Value for Byte 1 of 4 in the 32-bit IP address.
Two: Byte
Value for Byte 2 of 4 in the 32-bit IP address.
Three: Byte
Value for Byte 3 of 4 in the 32-bit IP address.
Four: Byte
Value for Byte 4 of 4 in the 32-bit IP address.
Description
SetAll is a procedure used to update the Byte values of the 32-bit IP address or network mask. SetAll is called when write operations to the IP address are performed from Assign, AsDoubleWord, AsString, AsBinaryString, and ByteArray.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.