A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jDataView/jBinary/wiki/Typesets below:

Typesets · jDataView/jBinary Wiki · GitHub

Typesets normally are just object dictionaries of typeName => type pairs with types that can refer to each other and completely describe some data structure format:

{
  'jBinary.all': 'File',
  'jBinary.littleEndian': true,

  // declaring custom type by wrapping structure
  DynamicArray: jBinary.Template({
    setParams: function (itemType) {
      this.baseType = {
        // using built-in type
        length: 'uint16',
        // using complex built-in type with simple argument and argument from another field
        values: ['array', itemType, 'length']
      };
    },
    read: function () {
      return this.baseRead().values;
    },
    write: function (values) {
      this.baseWrite({
        length: values.length,
        values: values
      });
    }
  }),

  // declaring simple structure
  FileItem: {
    // using built-in type with argument
    name: ['string0', 256],
    // using another custom type with no arguments
    content: 'DynamicArray'
  },

  // aliasing FileItem[] as type of entire File
  File: ['array', 'FileItem']
}

As was shown above, typesets may also contain special config values that set some global options for entire typeset.

As for now, such options are:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4