Indy 9
|
TQueryResult = class(TCollection)
TQueryResult provides property that identify field values returned in the DNS response message packet, including QueryClass, QueryType, and DomainName. TQueryResult also implements the Items property to provide indexed access to resource records returned in the Answer, Authority, or Additional sections of the DNS response.
TQueryResult provides method maintain the TResultRecord collection of resource records for the DNS response, including Add and Clear.
property DomainName: String;
property Items [Index: Integer]: TResultRecord;
Items insures that read access to the collection always returns a TResultRecord instance. Applications can examine TResultRecord.RecType for the returned item to determine if another TResultRecord descendant can be used to access additional properties and methods for the resource record.
property QueryClass: Word;
Note: Currently, the TIdDNSResolver implementation does not support all aspects of the DNS protocol, and includes the following limitations:
property QueryType: Word;
Note: Currently, the TIdDNSResolver implementation does not support all aspects of the DNS protocol, and includes the following limitations:
function Add(Answer: string; var APos: Integer): TResultRecord;
Add extracts the values used for Name, TTL, RData, RDataLength, RecType, and RecClass in the TResultRecord return value. Add also insures that the proper TResultRecord descendant is created to represent the resource record based on the the value in RecType. Add can create instances of TResultRecord descendants like TARecord, TNSRecord, TMXRecord, TNAMERecord, TSOARecord, THINFORecord, TTextRecord, TWKSRecord, TPTRRecord, and TMINFORecord. When an unsupported resource record type is encountered, Add creates a generic TResultRecord instance.
Add also call the TResultRecord.Parse method to read RData values in the resource record into their property counterparts.
Add updates the value in APos to indicate when values for the resource record have been read and processed.
Use Items to access resource records created for the query result.
procedure Clear; reintroduce;
constructor Create(AResultRecord: TResultRecord);
Create assigns the value in AResultRecord to the internal TResultRecord maintained by the object instance. Create also allocates resources using for the internal qwuery pointer list used to handle compressed resource records.
destructor destroy; override;
Destroy calls the inherited Destroy method prior to exiting.