Unigine::PackageUng Class
Header: | #include <UniginePackageUng.h> |
PackageUng Class
Members
static PackageUngPtr create ( const char * password = 0, int compression_type = 2 ) #
Constructor. Creates a package using specified compression type, protected by a given password, if provided. By default a package is created using ZLIB compression and without password protection.Arguments
- const char * password - Password.
- int compression_type - Compression type. One of the COMPRESSION_* variables.
Ptr<PackageUng> clone ( ) #
Clones the package.void close ( ) #
Closes the package.bool createPackage ( const char * name ) #
Creates a package with a given name.Arguments
- const char * name - Package name.
Return value
true if a package was created successfully; otherwise, false.int getCompressionType ( ) const#
Returns the type of compression used in the package.Return value
Compression type. One of the COMPRESSION_* variables.const char * getFileName ( int num ) #
Returns the name of a file with a given ID.Arguments
- int num - File ID. A number between 0 and the total number of files in the package.
Return value
File name.int getNumFiles ( ) const#
Returns the number of files in the package.Return value
Number of files.int isSupported ( ) #
Returns a value indicating if UNG-packages are supported.Return value
1 if UNG packages are supported; otherwise, 0.UNG-packages are not supported in evaluation version.
bool load ( const char * name ) #
Loads a package with a given name.Arguments
- const char * name - Package name.
Return value
true if a package was loaded successfully; otherwise, false.bool readFile ( byte[] data, size_t size ) #
Reads the contents of the currently selected file and puts it into the data array.This operation is performed for a currently selected file. To select a file use selectFile().
Arguments
- byte[] data - Data array.
- size_t size - File size, in bytes.
Return value
true if a file was read successfully; otherwise, false.bool selectFile ( const char * name, size_t & size ) #
Selects a file with a given name as a current one and puts its size to size.Arguments
- const char * name - File name.
- size_t & size - Integer variable to store the size of the selected file.
Return value
true if a file was selected successfully; otherwise, false.bool writeFile ( const char * name, const unsigned char * OUT_data, size_t size ) #
Writes data to a file with a given name.Arguments
- const char * name - File name.
- const unsigned char * OUT_data - Data to be written.This output buffer is to be filled by the Engine as a result of executing the method.
- size_t size - Size of the data to be written, in bytes.
Return value
true if the data was successfully written to a file; otherwise, false.bool containsFile ( const char * name ) const#
Checks if the package contains the specified file.Arguments
- const char * name - File name.
Return value
true if the package contains the specified file; otherwise, false.bool removeFile ( const char * name ) #
Removes the specified file from the package.Arguments
- const char * name - File name.
Return value
true if the specified file is successfully removed from the package; otherwise, false.bool removeFile ( int num ) #
Removes the file with the specified ID from the package.Arguments
- int num - File ID. A number between 0 and the total number of files in the package.
Return value
true if the specified file is successfully removed from the package; otherwise, false.int findFile ( const char * name ) const#
Returns the file ID in the package by its name.Arguments
- const char * name - File name.
Return value
File ID. A number between 0 and the total number of files in the package, or -1, if the file doesn't exist.size_t getFileSize ( int num ) const#
Arguments
- int num
Last update:
2024-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)