Skip to content

class DataPackage

SgDataPackage keeps a number of data objects organized into one package.

Properties

PropertyDescription
NameThe name of the DataPackage object. (Inherited from Object)

Methods

MethodDescription
AccessExternalAccess an existing package belonging to another process.
AddFileOrDirectoryObjectAdds a file or directory (with all sub-objects) to the package. Note: If the source is a directory, all sub-objects (files, directories) will be added, recursively.
AddObserverAdds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)
AddTextObjectAdds a text object to the package.
ClearClears the current package, and removes any temporary files.
CloseExternalCloses a previously opened external package access.
GetAllObjectNamesReturns an array with the names of all objects in the package.
GetClassGet the name of the DataPackage class. (Inherited from Object)
GetFileOrDirectoryObjectContentsExtract a file or directory from the package to a named output path.
GetFileOrDirectoryObjectPathGet a path to the file or directory of a named object IF the named object exists, and is a file or directory, else returns an empty path. Warning! Do not modify the contents in this folder. To modify the contents, use GetFileOrDirectoryObjectContents to retrieve the file data, modify, and add a new object using the new data.
GetObjectDataTypeReturns the data type of a named object. This will return an invalid value if the object does not exist.
GetObjectMIMETypeReturns the MIME type of a named object, if the type was specified when the object was added. This will return an empty string if the object does not exist, or if the objectName parameter is invalid.
GetObjectOriginalFileNameReturns the original file name of the object, if an original file name existed.
GetTextObjectContentsGet the text content IF the named object exists, and is a text object. If the object is not a text object, or the object does not exist, the return is empty.
HasObjectChecks if a package contains a named object. If the parameter is invalid, the return is false.
IsAReturns true if DataPackage is a or is a descendant of the class named as the type parameter. (Inherited from Object)
IsEmptyReturns true if no objects exist in the package.
IsExternalReturns true if the package is currently used to access an external package.
IsLockedReturns true if the package is currently locked for external access.
IsNullReturns true if the DataPackage object is invalid. (Inherited from Object)
IsSameObjectAsReturns true if the DataPackage object is valid. (Inherited from Object)
LoadLoad a package from a file.
LockPrepare and lock the package for external access.
NonNullReturns true if the DataPackage object is valid. (Inherited from Object)
PrintInfoPrints the content/info of the DataPackage object to the log. (Inherited from Object)
RemoveObjectRemoves a named object from the package.
RemoveObserverRemoves a previously added observer object. (Inherited from Object)
SaveSaves the package to a file.
UnlockUnlock after external access, reload changed packages.

Static methods

MethodDescription
IsClassAReturns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)
SafeCastSafeCast makes sure the input object is of a class that can be cast into spDataPackage, and if this is the case, returns the object cast into spDataPackage. (Inherited from Object)

Properties details

Name

The name of the DataPackage object. (Inherited from Object)

Methods details

AccessExternal

Access an existing package belonging to another process.

AddFileOrDirectoryObject

Adds a file or directory (with all sub-objects) to the package. Note: If the source is a directory, all sub-objects (files, directories) will be added, recursively.

AddObserver

Adds a user-defined observer object to the interface, that will receive events from the interface. (Inherited from Object)

AddTextObject

Adds a text object to the package.

Clear

Clears the current package, and removes any temporary files.

CloseExternal

Closes a previously opened external package access.

GetAllObjectNames

Returns an array with the names of all objects in the package.

GetClass

Get the name of the DataPackage class. (Inherited from Object)

GetFileOrDirectoryObjectContents

Extract a file or directory from the package to a named output path.

GetFileOrDirectoryObjectPath

Get a path to the file or directory of a named object IF the named object exists, and is a file or directory, else returns an empty path. Warning! Do not modify the contents in this folder. To modify the contents, use GetFileOrDirectoryObjectContents to retrieve the file data, modify, and add a new object using the new data.

GetObjectDataType

Returns the data type of a named object. This will return an invalid value if the object does not exist.

GetObjectMIMEType

Returns the MIME type of a named object, if the type was specified when the object was added. This will return an empty string if the object does not exist, or if the objectName parameter is invalid.

GetObjectOriginalFileName

Returns the original file name of the object, if an original file name existed.

GetTextObjectContents

Get the text content IF the named object exists, and is a text object. If the object is not a text object, or the object does not exist, the return is empty.

HasObject

Checks if a package contains a named object. If the parameter is invalid, the return is false.

IsA

Returns true if DataPackage is a or is a descendant of the class named as the type parameter. (Inherited from Object)

IsEmpty

Returns true if no objects exist in the package.

IsExternal

Returns true if the package is currently used to access an external package.

IsLocked

Returns true if the package is currently locked for external access.

IsNull

Returns true if the DataPackage object is invalid. (Inherited from Object)

IsSameObjectAs

Returns true if the DataPackage object is valid. (Inherited from Object)

Load

Load a package from a file.

Lock

Prepare and lock the package for external access.

NonNull

Returns true if the DataPackage object is valid. (Inherited from Object)

PrintInfo

Prints the content/info of the DataPackage object to the log. (Inherited from Object)

RemoveObject

Removes a named object from the package.

RemoveObserver

Removes a previously added observer object. (Inherited from Object)

Save

Saves the package to a file.

Unlock

Unlock after external access, reload changed packages.

Static methods details

IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter. (Inherited from Object)

SafeCast

SafeCast makes sure the input object is of a class that can be cast into spDataPackage, and if this is the case, returns the object cast into spDataPackage. (Inherited from Object)