C# Class Nanook.QueenBee.Parser.QbFile

Datei anzeigen Open project: Nanook/Queen-Bee Class Usage Examples

Public Methods

Method Description
AddItem ( QbItemBase item ) : void
AlignPointers ( ) : void
CreateGenericArrayItem ( QbItemBase parent ) : GenericQbItem

Creates an array item based on the data type of the parent.

CreateQbItemType ( QbFile qbFile, QbItemType type ) : QbItemBase
CreateQbItemType ( QbFile qbFile, QbItemType type, QbFormat qbFormat ) : QbItemBase
FindItem ( QbItemType type, bool recursive ) : QbItemBase
FindItem ( QbKey key, bool recursive ) : QbItemBase
FindItem ( bool recursive, Predicate match ) : QbItemBase
FormatBadPointerExceptionMessage ( object sender, uint streamPos, uint pointer ) : string
FormatIsValidErrorMessage ( QbItemBase item, IsValidReturnType errorType ) : string
FormatWriteLengthExceptionMessage ( object sender, uint start, uint end, uint length ) : string
GetGenericItems ( QbItemBase item ) : List

Analyse the attributes on the item and return the editable items

InsertItem ( QbItemBase item, QbItemBase sibling, bool beforeAfter ) : void

Insert a new item before or after the sibling item.

IsValid ( ) : QbItemBase
QbFile ( Stream stream, PakFormat pakFormat ) : System
QbFile ( Stream stream, string debugFileContents, PakFormat pakFormat ) : System
QbFile ( string filename, PakFormat pakFormat ) : System
QbFile ( string filename, string debugFilename, PakFormat pakFormat ) : System
QbFile ( string filename, string debugFileContents, Stream stream, PakFormat pakFormat ) : System

Open using a stream, filename is just for reference. The stream must start with the file (the position is depended on)

RemoveItem ( QbItemBase item ) : void

Remove the specified item from this items children

SetGenericItems ( QbItemBase item, List gItems ) : void
SetNewFileId ( ) : void

The FileId is based on the filename, this will recalculate it, GH3 has a bug where the first character is missing from the path. The FileId doesn't appear to affect the game, it may just need to be unique

SupportedChildTypes ( QbItemType parent ) : QbItemType[]
SupportsChild ( QbItemType parent, QbItemType child ) : bool
Write ( Stream s ) : void
Write ( string filename ) : void

Private Methods

Method Description
LookupDebugName ( uint debugCrc ) : string
LookupDebugName ( uint debugCrc, bool allowUserQbkeyLookup ) : string
QbFile ( ) : System
QbFile ( string qbFilename, PakFormat pakFormat, uint magic, byte unknownData ) : System

Create a blank QbFile

SearchItems ( QbFile qbFile, List qibs, bool recursive, Predicate match ) : QbItemBase
StreamPos ( Stream stream ) : uint

Subtracts the start offset of the stream from current position

createQbItemType ( QbFile qbFile, QbItemType type, QbFormat qbFormat, bool hasQbFormat ) : QbItemBase
loadDebugFile ( string debugFileContents ) : void
parse ( Stream stream ) : void
recurseIsValid ( QbItemBase item ) : QbItemBase
startLengthCheck ( BinaryEndianWriter bw ) : void
testLengthCheck ( object sender, BinaryEndianWriter bw ) : ApplicationException

Method Details

AddItem() public method

public AddItem ( QbItemBase item ) : void
item QbItemBase
return void

AlignPointers() public method

public AlignPointers ( ) : void
return void

CreateGenericArrayItem() public static method

Creates an array item based on the data type of the parent.
public static CreateGenericArrayItem ( QbItemBase parent ) : GenericQbItem
parent QbItemBase Must be a simple array type
return GenericQbItem

CreateQbItemType() public static method

public static CreateQbItemType ( QbFile qbFile, QbItemType type ) : QbItemBase
qbFile QbFile
type QbItemType
return QbItemBase

CreateQbItemType() public static method

public static CreateQbItemType ( QbFile qbFile, QbItemType type, QbFormat qbFormat ) : QbItemBase
qbFile QbFile
type QbItemType
qbFormat QbFormat
return QbItemBase

FindItem() public method

public FindItem ( QbItemType type, bool recursive ) : QbItemBase
type QbItemType
recursive bool
return QbItemBase

FindItem() public method

public FindItem ( QbKey key, bool recursive ) : QbItemBase
key QbKey
recursive bool
return QbItemBase

FindItem() public method

public FindItem ( bool recursive, Predicate match ) : QbItemBase
recursive bool
match Predicate
return QbItemBase

FormatBadPointerExceptionMessage() public static method

public static FormatBadPointerExceptionMessage ( object sender, uint streamPos, uint pointer ) : string
sender object
streamPos uint
pointer uint
return string

FormatIsValidErrorMessage() public static method

public static FormatIsValidErrorMessage ( QbItemBase item, IsValidReturnType errorType ) : string
item QbItemBase
errorType IsValidReturnType
return string

FormatWriteLengthExceptionMessage() public static method

public static FormatWriteLengthExceptionMessage ( object sender, uint start, uint end, uint length ) : string
sender object
start uint
end uint
length uint
return string

GetGenericItems() public static method

Analyse the attributes on the item and return the editable items
public static GetGenericItems ( QbItemBase item ) : List
item QbItemBase
return List

InsertItem() public method

Insert a new item before or after the sibling item.
public InsertItem ( QbItemBase item, QbItemBase sibling, bool beforeAfter ) : void
item QbItemBase Item to insert.
sibling QbItemBase
beforeAfter bool Insert before=True or after=False
return void

IsValid() public method

public IsValid ( ) : QbItemBase
return QbItemBase

QbFile() public method

public QbFile ( Stream stream, PakFormat pakFormat ) : System
stream Stream
pakFormat PakFormat
return System

QbFile() public method

public QbFile ( Stream stream, string debugFileContents, PakFormat pakFormat ) : System
stream Stream
debugFileContents string
pakFormat PakFormat
return System

QbFile() public method

public QbFile ( string filename, PakFormat pakFormat ) : System
filename string
pakFormat PakFormat
return System

QbFile() public method

public QbFile ( string filename, string debugFilename, PakFormat pakFormat ) : System
filename string
debugFilename string
pakFormat PakFormat
return System

QbFile() public method

Open using a stream, filename is just for reference. The stream must start with the file (the position is depended on)
public QbFile ( string filename, string debugFileContents, Stream stream, PakFormat pakFormat ) : System
filename string
debugFileContents string
stream Stream
pakFormat PakFormat
return System

RemoveItem() public method

Remove the specified item from this items children
public RemoveItem ( QbItemBase item ) : void
item QbItemBase Item to remove
return void

SetGenericItems() public static method

public static SetGenericItems ( QbItemBase item, List gItems ) : void
item QbItemBase
gItems List
return void

SetNewFileId() public method

The FileId is based on the filename, this will recalculate it, GH3 has a bug where the first character is missing from the path. The FileId doesn't appear to affect the game, it may just need to be unique
public SetNewFileId ( ) : void
return void

SupportedChildTypes() public static method

public static SupportedChildTypes ( QbItemType parent ) : QbItemType[]
parent QbItemType
return QbItemType[]

SupportsChild() public static method

public static SupportsChild ( QbItemType parent, QbItemType child ) : bool
parent QbItemType
child QbItemType
return bool

Write() public method

public Write ( Stream s ) : void
s Stream
return void

Write() public method

public Write ( string filename ) : void
filename string
return void