nNpkFileServer Class Reference
[NPK File Management]
#include <nnpkfileserver.h>
Inheritance diagram for nNpkFileServer:

Detailed Description
Implement reading from npk files.See also nNpkFileServer Script Interface
npk file format:
# header
block HEADER {
uint32 'NPK0' // magic number
uint32 blockLen // number of following bytes in block
uint32 dataOffset // byte offset of data block from beginning of file
}
# table of contents, sequence of blocks of 3 types:
block DIR {
uint32 'DIR_' // magic number of directory block
uint32 blockLen // number of following bytes in block
uint16 dirNameLength // length of the following name
char[] dirName // name of directory
}
block FILE {
uint32 'FILE' // magic number of file block
uint32 blockLen // number of following bytes in block
uint32 fileOffset // start of file data inside data block
uint32 fileLength // length of file data in bytes
uint16 fileNameLength // length of the following name
char[] fileName // name of file
}
block ENDOFDIR {
uint32 'DEND' // magic number of end of dir block
uint32 blockLen // number of following bytes in block (0)
}
# the data block
block DATA {
uint32 'DATA' // magic number of data block
uint32 blockLen // number of following bytes in block
char[] data // the data
}
(C) 2002 RadonLabs GmbH
Definition at line 58 of file nnpkfileserver.h.
Public Member Functions | |
| nNpkFileServer () | |
| constructor | |
| virtual | ~nNpkFileServer () |
| destructor | |
| virtual nFile * | NewFileObject () const |
| create new nNpkFile object | |
| virtual nDirectory * | NewDirectoryObject () const |
| create new nNpkDirectory object | |
| virtual bool | ParseNpkFile (const nString &path) |
| parse one npk file | |
| virtual int | ParseDirectory (const nString &dirName, const nString &extension) |
| parse the given directory for npk files | |
| virtual void | ReleaseNpkFiles (const nString &pattern) |
| release npk file wrappers matching pattern | |
| virtual bool | Pack (const nString &rootPath, const nString &dirName, const nString &npkName, bool noTopLevelName) |
| pack a directory into a new NPK file | |
Friends | |
| class | nNpkFile |
| class | nNpkDirectory |
Constructor & Destructor Documentation
|
|
constructor
Definition at line 18 of file nnpkfileserver_main.cc. |
|
|
destructor
Definition at line 26 of file nnpkfileserver_main.cc. |
Member Function Documentation
|
|
create new nNpkFile object
Reimplemented from nFileServer2. Definition at line 40 of file nnpkfileserver_main.cc. |
|
|
create new nNpkDirectory object
Reimplemented from nFileServer2. Definition at line 51 of file nnpkfileserver_main.cc. |
|
|
parse one npk file Parses a single npk file and adds it to the list of npk files. Definition at line 63 of file nnpkfileserver_main.cc. |
|
||||||||||||
|
parse the given directory for npk files Scan through a directory for npk files and create a nNpkFileWrapper object for each npk file found, and open the npk files. Returns the number of npk files found. Definition at line 86 of file nnpkfileserver_main.cc. |
|
|
release npk file wrappers matching pattern This releases all NPK file wrappers whose filename matches a given pattern. Definition at line 212 of file nnpkfileserver_main.cc. |
|
||||||||||||||||||||
|
pack a directory into a new NPK file Pack a directory into new NPK file. The directory will *NOT* be removed after the operation. NOTE: if the "noRootName" argument is set, there will be no directory name stored in the npk file for the toplevel directory, instead, the current filename of the npk file (without extension) will be used for the toplevel directory's name when reading from the npk file. Use with care, the default should be false.
Definition at line 200 of file nnpkfileserver_main.cc. |
Friends And Related Function Documentation
|
|
Definition at line 60 of file nnpkfileserver.h. |
|
|
Definition at line 61 of file nnpkfileserver.h. |
The documentation for this class was generated from the following files: