DataContainer - Placeholder class to represent various ways of loading and storing data.
use DataContainer;
my $dc=DataContainer->new();
$dc->load("whatever");
$dc->save("something");
A collection of functions to handle the conversion to and from unixtime and iso8601-time.
Instantiates the class
The method supports the following parameters:
location The location of the data. SCALAR. Only has meaning to the inheriting class.
name The name of the data container. SCALAR. Only has meaning to the inheriting class.
collection The collection instance to use for this DataContainer. See the ContentCollection-class's documentation.
Returns an instanciated class upon success.
Reset the data that has been loaded into the DataContainer.
No input accepted.
Returns 1.
Open the DataContainer for reading and/or saving.
Accepts only one parameter "name". SCALAR. Optional. If it is specified it overrides the name specified to the constructor. Name only has meaning to the overriding sub-class.
Return 1 upon success, 0 upon failure. Please check the error()-method upon failure.
This is a placeholder method that is to be overridden and given meaning by the inheriting sub-class.
Returns if the DataContainer has been opened or not?
Accepts no input parameters.
Returns 1 if opened, 0 if not.
Close the DataContainer.
Accepts only one optional parameter "name" SCALAR. If it is specified it overrides the name specified to the constructor. Name only has meaning to the overriding/ inheriting class.
Returns 1 upon success, 0 upon failure. Please check the error()-method upon failure.
This is a placeholder method that is to be overridden and given meaning by the inheriting sub-class.
Sets the ContentCollection instance of the object.
Input is the ContentCollection instance to set.
Returns 1 upon success, 0 upon failure.
Get the ContentCollection instance for the object.
No input is accepted.
Returns the ContentCollection-instance. If it has not been set at any point it returns a new ContentCollection-instance.
Load data into the DataContainer using the ContentCollection-instance.
Accepts one parameter "name". SCALAR. Optional. If not specified defaults to the name-parameter of the constructor. The meaning of "name" is up to the inheriting sub-class.
Returns 1 upon success, 0 upon failure. Please check the error()-method for more information upon failure.
This is a placeholder class and is to be overridden by the inheriting sub-class.
Save data to the DataContainer using the ContentCollection-instance.
Accepts one parameter "name". SCALAR. Optional. If not specified defaults to the name-parameter of the constructor. The meaning of "name" is up to the inheriting sub-class.
Returns 1 upon success, 0 upon failure. Please check the error()-method upon failure.
This is a placeholder class and is to be overridden by the inheriting sub-class.
Delete data from the DataContainer.
Accepts one parameter "name". SCALAR. Optional. If not specified defaults to the name-parameter of the constructor. The meaning of "name" is up to the inheriting class.
Returns 1 upon success, 0 upon failure. Please check the error()-method upon failure.
This is a placeholder class and is to be overridden by the inheriting sub-class.
Get or set the mode of the DataContainer.
Accepted input is the parameter "mode" that specifies the mode to set.
The following mode-constants are acceptable:
$MODE_READ (only reading allowed)
$MODE_READWRITE (read/write allowed)
$MODE_OVERWRITE (overwrite any existing file)
$MODE_APPEND (add data to the DataContainer, do not overwrite)
Returns the value of the mode set if success, 0 upon failure. Please check the error()-method for more information upon any failure.
Get or set the name of the DataContainer.
Accepts only one parameter. SCALAR. Optional. If one parameter is specified, it will be interpreted as a set-operation.
Returns 1 upon success setting the name, or the name of the DataContainer upon success getting it.
Gets or sets the location parameter.
Accepts only one parameter. SCALAR. Optional. If a parameter is specified, it will be interpreted as a set-operation.
Returns 1 upon success setting the location, or the location of the DataContainer upon success getting it.
Gets the last error that the package/instance did.
Accepts no input.
Upon success returns the last known error as a SCALAR.