PROPERTIES (RPGLE)

Property files
Details ....

Copybooks  

unicode_h.rpgle
properties_h.rpgle
rng/input_provider_h.rpgle
rng/streamfile_input_provider_h.rpgle
libtree/libtree_h.rpgle
arraylist_h.rpgle
libc_h.rpgle

Procedures  

properties_clearexported
Clear properties object
properties_containsexported
Check property existence
properties_createexported
Create new properties object
properties_dumpexported
Dump properties
properties_finalizeexported
Dispose properties object
properties_getexported
Get property value
properties_listexported
List property keys
properties_loadexported
Load property file
properties_putexported
Add property
properties_sizeexported
Get number of properties

Detailed Description  

The Properties service program provides procedures to work on/with a persistent set of properties (key/value pair). Properties can be loaded from or saved to a stream file. Keys and Values are both of data type string. Each key can only exist once in a set of properties.

The load procedure will load all properties from a stream file. LF (x'25') and CRLF (x'0D25') are supported as line separation characters. All natively supported codepages can be processed by the load procedure.
Author:
Mihael Schmidt
Date:
29.04.2011

Procedure Documentation  

properties_clear  

voidproperties_clear(Pointer)
Removes all properties from the object.
Parameter:
Pointer   constPointer to properties object
Exported.

properties_contains  

Booleanproperties_contains(Pointer, Zeichen)
Checks if the properties object contains the passed property key.
Parameter:
Pointer   constPointer to properties object
Zeichen (65535)   const   varyingKey
Return value:
Boolean*on = property exists otherwise false
Exported.

properties_create  

Pointerproperties_create()
Return value:
PointerPointer to new properties object
Exported.

properties_dump  

voidproperties_dump(Pointer)
Outputs all properties to the screen (via opcode DSPLY).
Parameter:
Pointer   constPointer to properties object
Exported.

properties_finalize  

voidproperties_finalize(Pointer)
Releases all allocated resources.
Parameter:
PointerPointer to properties object
Exported.

properties_get  

Zeichenproperties_get(Pointer, Zeichen, Zeichen)
Returns the value to the passed property key.

If the property does not exist and a default value is passed the default value will be returned.
Parameter:
Pointer   constPointer to properties object
Zeichen (65535)   const   varyingKey
Zeichen (65535)   const   varying   optionalDefault value (optional)
Return value:
Zeichen (65535)Property value or *blank if the property does not exist.
Exported.

properties_list  

Pointerproperties_list(Pointer)
Returns a list with the property keys from this properties object.
Parameter:
Pointer   constPointer to properties object
Return value:
PointerList with property keys
Exported.
Infos:
  The resources of the returned list must be released by the caller with the procedure arraylist_finalize.

properties_load  

Pointerproperties_load(Zeichen, Zeichen, Pointer)
Loads the properties from the passed file or alternative input provider.
Parameter:
Zeichen (1024)   const   varying   omissiblePath to proptery file (optional if alt. input provider passed)
Zeichen (1)   const   optional   omissibleSeparator (default: = )
Pointer   const   optionalAlternative Input Provider
Return value:
PointerPointer to properties object or *null if an error occured
Exported.
Author:
Mihael Schmidt
Date:
29.04.2011

properties_put  

voidproperties_put(Pointer, Zeichen, Zeichen)
Adds the passed property to the properties object. If a property with the passed key already exists the value of the property will be replaced with the passed value.
Parameter:
Pointer   constPointer to properties object
Zeichen (65535)   const   varyingKey
Zeichen (65535)   const   varyingValue
Exported.

properties_size  

Integerproperties_size(Pointer)
Returns the number of properties in this properties object.
Parameter:
Pointer   constPointer to properties object
Return value:
Numerisch (Integer) (10)Number of properties
Exported.