WriteArchiveInterface Class Reference IO

#include <ioarchivehandler.h>

Inheritance diagram for WriteArchiveInterface:

详细描述

Interface class to write archives.

公共成员函数

MAXON_METHOD Result < void >  Open (const Url &inputFile, Bool append, const String &password= String ())
MAXON_METHOD Result < void >  关闭 ()
MAXON_METHOD Result < void >  SetCompressionLevel ( Int compressionLevel)
MAXON_METHOD Int   GetCompressionLevel () const
MAXON_METHOD Result < void >  CreateDirectory (const String &name, const UniversalDateTime &dateTime, IOATTRIBUTES fileAttributes)
MAXON_METHOD Result < void >  CreateFile (const String &name, const UniversalDateTime &dateTime, IOARCHIVESTOREMETHOD method, IOATTRIBUTES fileAttributes, UInt32 cryptCrc)
MAXON_METHOD Result < void >  WriteFile (const Block < const Byte > &data)
MAXON_METHOD Result < void >  CloseFile ()
MAXON_METHOD Result < void >  CopyFile (const Url &fn, const String &str, IOATTRIBUTES fileAttributes= IOATTRIBUTES::NONE , IOATTRIBUTES fileAttributesMask= IOATTRIBUTES::NONE )

私有成员函数

  MAXON_INTERFACE ( WriteArchiveInterface , MAXON_REFERENCE_NORMAL , "net.maxon.interface.writearchive")

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( WriteArchiveInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.interface.writearchive"   
)
private

◆  Open()

MAXON_METHOD Result <void> Open ( const Url inputFile ,
Bool   append ,
const String password = String()  
)

Opens an archive for writing.

参数
[in] inputFile The path of the archive.
[in] append True if files shall be added to an existing archive.
[in] password An optional password.
返回
OK on success.

◆  Close()

MAXON_METHOD Result <void> Close ( )

Closes the archive and finishes all write operations. After that call the file is closed.

返回
OK on success.

◆  SetCompressionLevel()

MAXON_METHOD Result <void> SetCompressionLevel ( Int   compressionLevel )

Sets the compression level for files in the archive. This function can be called before a new CreateFile() operation to change the compression level. One call at the beginning is enough.

参数
[in] compressionLevel Compression level depending on the compression algorithm [ zip: 0 (low) ... 9 (high) ].
返回
OK on success.

◆  GetCompressionLevel()

MAXON_METHOD Int GetCompressionLevel ( ) const

Returns the current compression level.

返回
The current compression level.

◆  CreateDirectory()

MAXON_METHOD Result <void> CreateDirectory ( const String name ,
const UniversalDateTime dateTime ,
IOATTRIBUTES   fileAttributes  
)

Creates a directory within an archive file. The name should contain '/' as directory separator.

参数
[in] name The name of the directory. use '/' to separate subdirectories.
[in] dateTime The file time/date of the directory.
[in] fileAttributes OS file attributes.
返回
OK on success.

◆  CreateFile()

MAXON_METHOD Result <void> CreateFile ( const String name ,
const UniversalDateTime dateTime ,
IOARCHIVESTOREMETHOD   method ,
IOATTRIBUTES   fileAttributes ,
UInt32   cryptCrc  
)

Creates a file within an archive file. The name should contain '/' as directory separator. Use WriteFile() to write the data into the file. CloseFile() needs to be called to close the file. A file can be directly created within the archive without the need to create the parent directories first.

参数
[in] name The name of the directory. use '/' to separate subdirectories.
[in] dateTime The file time/date of the directory.
[in] method Gives the method how the file is stores in the archive.
[in] fileAttributes OS file attributes.
[in] cryptCrc CRC for crypting.
返回
OK on success.

◆  WriteFile()

MAXON_METHOD Result <void> WriteFile ( const Block < const Byte > &  data )

Writes data into the given file created by calling CreateFile() . Multiple calls to WriteFile() are possible for one single file.

参数
[in] data Buffer with file data.
返回
OK on success.

◆  CloseFile()

MAXON_METHOD Result <void> CloseFile ( )

Closes the file opened with CreateFile() .

返回
OK on success.

◆  CopyFile()

MAXON_METHOD Result <void> CopyFile ( const Url fn ,
const String str ,
IOATTRIBUTES   fileAttributes = IOATTRIBUTES::NONE ,
IOATTRIBUTES   fileAttributesMask = IOATTRIBUTES::NONE  
)

Copies a file into the archive file. The default parameter for the fileAttributes takes the bits from the original file. CopyFile(fn, str, IOATTRIBUTES::OWNER_X , IOATTRIBUTES::OWNER_X | IOATTRIBUTES::GROUP_X | IOATTRIBUTES::PUBLIC_X ); will take the original file bits but forces to set the unix X bits ontop of this only for the owner.

参数
[in] fn The source file name.
[in] str The virtual filename within the archive.
[in] fileAttributes Bits for the file attributes. Only corresponding bits in the mask are set/cleared.
[in] fileAttributesMask This mask defines, which bits are taken from fileAttributes (mask bit==1) and which are taken from the original file (mask bit==0).
返回
OK on success.