home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
vp21beta.zip
/
OEXMPSRC.RAR
/
EA
/
OS2EA.TXT
< prev
next >
Wrap
Text File
|
2000-08-15
|
4KB
|
102 lines
Virtual Pascal for OS/2 v1.01
Extended Attributes example class BETA
(C) 1996 fPrint UK Ltd
Introduction
~~~~~~~~~~~~
This archive contains a sample class for Virtual Pascal for OS/2 to
ease accessing OS/2 Extended Attributes.
The aim of this class is to help you produce OS/2 applications with
Virtual Pascal for OS/2 that utilise the power of OS/2's Extended
Attributes without any large overhead in terms of finding out
which API calls are required.
To use this class, you need Virtual Pascal v1.01 Beta 2 or later.
What it does
~~~~~~~~~~~~
This class encapsulates most of the basics of accessing and modifying
a list of EA's associated with a file in OS/2.
As demonstrated in the sample app, TestEA, getting a list of EAs for
a file, displaying the list and modifying it, is very easy.
setting up a basic DIVE
The first step is to call the tEAList Create constructor, which takes
a file name as the parameter. The file must exist, or the call will
raise an EEAError. When the constructor returns, it contains a
collection of extended attributes associated with the file.
The Items array is used to access individual EA items; the Count
property tells how many EA's are currently in the list.
To add a new EA to the list, call the relevant Add* method; there are
methods for adding general EA's and EA's of String type. Each add
method exists in several flavours that allow you to pass either pChars
or Pascal Strings as any parameter.
To remove an EA, either call RemoveEA with a specific Item as the
parameter, or call RemoveNamedEA to remove an EA with a specific name,
To search for an EA with a given name, use the SearchFor function,
which takes the name of an EA as an argument, and returns a tEA object.
When you have finished modifying the list of EA's, call the WriteToFile
method to write the changes back to disk.
In any case, after finishing using the class, free the memory used by
calling the Destroy destructor.
The EA items
~~~~~~~~~~~~
Each EA item can provide information about itself; some of this
information can also be modified. All EA's can return the following
information:
EANameZ: pChar // Name of EA data, pChar
EAName: String // Name of EA data, String
EAData: Pointer // Pointer to raw EA data
EALength: SmallWord // Length of raw EA data
EAType: SmallWord // EA Type
GetString: String; // EA string representation
In addition, EA's of type String provide more options. These EA's
have got a StringValue property, which can be modified to give the
EA a new value. To modify the value of other types of EA's, you need
to expand the base EA class framework in the same manner as has been
done for the tEA_Ascii class.
For more information on how to use the tEAList, tEA and tEA_Ascii
classes, please refer to the source code in Os2EA.Pas and TestEA.Pas.
Contact Address
~~~~~~~~~~~~~~~
Bug reports or feature requests should be directed to one of the
following addresses:
fPrint UK Ltd
Cambridge House
Hammersmith
London W6 0LE
United Kingdom
Att: Allan Mertner
Tel. +44 (181) 563 2359
Fax. +44 (181) 563 2361
BBS +44 (181) 563 8624
Internet: vpascal@ibm.net
CompuServe: 102212,3041
FidoNet: 2:254/283
WWW: http://www.fprint.co.uk/vpascal
CompuServe: GO FPRINT
or select OS/2 Vendor Forum B (GO OS2BVEN) Section 6.
Trademarks
~~~~~~~~~~
Company names, brand names and product names are trademarks or
registered trademarks of their respective holders.