[Lazarus] How to get the package version from a LPK file?
Graeme Geldenhuys
graemeg.lists at gmail.com
Tue Nov 29 16:40:35 CET 2011
On 29/11/2011, Hans-Peter Diettrich <DrDiettrich1 at .....com> wrote:
>> For those too lazy to read the article, here is the gist of it.
>>
>> type
>> TxmlNode = class
>> property Name: string;
>> property Value: string;
>> property Parent: TxmlNode;
>> property Child[Idx: integer]: TxmlNode;
>> property ChildrenCount: integer;
>> property Node[Path:string]: TxmlNode; default;
>> end;
>
> How does this help with documentation entries like
> <element link="BaseClass.AMethod" name="MyClass.MyMethod">
> ???
Sorry, my mistake. That is just a "summary" of the TXMLNode interface.
Here is the full interface from that article's source code. I added
the last two properties myself. Note, that this interface has access
to attributes.
TxmlNode = class
private
FName: string;
FValue: string;
FParent: TxmlNode;
Attr: TStringList;
Nodes: TList;
FXMLRCTrans: IXMLReservedCharsTranslator;
function GetAttribute(AttrName: string): string;
function GetChild(Idx: integer): TxmlNode;
function GetNode(Path: string): TxmlNode;
procedure SetAttribute(AttrName: string; const Value: string);
procedure SetName(const Value: string);
procedure SetValue(const Value: string);
function GetAttributesCount: integer;
function GetChildrenCount: integer;
function GetAttributeByIdx(Idx: integer): string;
function GetAttributeNameByIdx(Idx: integer): string;
public
constructor Create;
constructor CustomCreate(pName: String);
destructor Destroy; override;
property Name: string read FName write SetName;
property Value: string read FValue write SetValue;
property Parent: TxmlNode read FParent;
property Attribute[AttrName:string]:string read GetAttribute
write SetAttribute;
property AttributeByIdx[Idx: integer]:string read GetAttributeByIdx;
property AttributeNameByIdx[Idx: integer]:string read
GetAttributeNameByIdx;
property AttributesCount: integer read GetAttributesCount;
property Child[Idx: integer]: TxmlNode read GetChild;
property ChildrenCount: integer read GetChildrenCount;
property Node[Path:string]: TxmlNode read GetNode; default;
procedure AddChild(ANode: TxmlNode); overload;
function AddChild(pName, pValue: String): TxmlNode; overload;
function ChildByName(AName: string): TxmlNode;
function AsXml: string;
procedure AsXmlStringList(var pList: TStringList; var pSpacer: Integer);
end;
--
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net
More information about the Lazarus
mailing list