Archive
ReferencesThis class represents a complete file. Grasshopper2 files are essentially zip-archives containing a mixture of textual, binary and node-based entries.
Constructors
Fields
FileExtension
#Gets the file extension used for Grasshopper 2.0 files (minus the period). The extension is "ghz" which stands for GrassHopperZip(ped).
Properties
Indexers
Methods
AddData
#Add byte-array content to this archive.
AddDataUnsafe
#Add byte-array content to this archive without copying. Only use this method if you know there is no chance of the byte array being shared.
AddRoot
#Add a root node to this archive.
AddText
#Add text content to this archive.
EnumerateAndExecute
#Enumerate over all elements in this archive and invoke a delegate for each.
public void EnumerateAndExecute()
textMethod = null,
Method for handling text data.
dataMethod = null,
Method for handling byte array data.
rootMethod = null,
Method for handling root nodes.
nodeMethod = null,
Method for handling all nodes (including root nodes).
itemMethod = null
Method for handling item data.
GetDataUnsafe
#Get the byte-array associated with the given path. This method provides direct access to the internal array without duplication, so only use it if you're not going to modify this array.
Returns: Bytes or null if no such byte path exists.
GetText
#Try to get the text associated with the given path.
Returns: Text or null if no such text path exists.
Creates a new object that is a copy of the current instance.
Returns: A new object that is a copy of this instance.
Write
#An overload that writes this archive to a file on the disk, and reports the number of written bytes.