EA (class library): Difference between revisions
Appearance
Line 27: | Line 27: | ||
; name() : This function returns the value of the name data-member of the EA. | ; name() : This function returns the value of the name data-member of the EA. | ||
const IString& name() const; | const IString& name() const; | ||
; value() : Returns the value of the value data-member of the given object. | ; value() : Returns the value of the value data-member of the given object. | ||
Line 44: | Line 42: | ||
BYTE flag() const; | BYTE flag() const; | ||
==Functions to change data-members== | |||
; setName() : Sets the name data-member of the given object to name. | |||
EA& setName(const IString& name); | |||
; setValue() : Sets the value data-member of the given object to value. | |||
EA& setValue(const IString& value); | |||
; setType() : Sets the type data-member of the given object to type. Predefined values for type are defined in <bsedos.h>. | |||
EA& setType(USHORT type); | |||
; setFlag() : Sets the flag data-member of the given object. Valid values for flag are 0 and FEA_NEEDEA. | |||
EA& setFlag(BYTE flag); | |||
==Functions for interaction with files== | ==Functions for interaction with files== |
Revision as of 23:30, 16 September 2016
Public members of class EA:
Constructors
There are three public constructors:
EA(const IString& name, const void* buffer, unsigned long length, USHORT type=EAT_BINARY, BYTE flag=0); EA(const IString& name="", const IString& value="", BYTE flag=0); EA(const IString& name, const EAList& list, BYTE flag=0);
The first constructor can be used to construct EAs of any type, the second constructs an EA of type EAT_ASCII and the third converts an EAList to a MV-EA.
Predefined types are defined in <bsedos.h>. The only valid value for the flag parameter besides 0 is FEA_NEEDEA. In the latter case the EA is marked as critical and only programs explicitly supporting EAs can process the file.
Data-member access functions
- name()
- This function returns the value of the name data-member of the EA.
const IString& name() const;
- value()
- Returns the value of the value data-member of the given object.
const IString& value() const;
- type() ; Returns the value of the type data-member of the given object.
USHORT type() const;
- typeAsString()
- Converts the value of type (resp. the value of the type data-member of the given object) to a string. If the type is not one of the predefined EAT_ types, the functions return "Unknown(xxxx)" were xxxx is the value of the type in hex.
static IString typeAsString(USHORT type); IString typeAsString() const;
- flag()
- This function returns the value of the flag data-member of the EA.
BYTE flag() const;
Functions to change data-members
- setName()
- Sets the name data-member of the given object to name.
EA& setName(const IString& name);
- setValue()
- Sets the value data-member of the given object to value.
EA& setValue(const IString& value);
- setType()
- Sets the type data-member of the given object to type. Predefined values for type are defined in <bsedos.h>.
EA& setType(USHORT type);
- setFlag()
- Sets the flag data-member of the given object. Valid values for flag are 0 and FEA_NEEDEA.
EA& setFlag(BYTE flag);
Functions for interaction with files
read(), write(), remove()
Functions for multi-valued EAs: codePage(), numValues()