Module: Bindef::Schemas

Included in:
Bindef
Defined in:
lib/bindef/schemas.rb

Overview

Schemas used to validate commands and pragmas throughout Bindef.

Constant Summary collapse

PRAGMA_SCHEMA =

A mapping of valid pragma keys to lists of valid pragma values.

{
  verbose: [true, false],
  warnings: [true, false],
  endian: %i[big little],
  encoding: Encoding.name_list.map(&:downcase),
}.freeze
DEFAULT_PRAGMAS =

The default pragma settings.

{
  verbose: false,
  warnings: true,
  endian: :little,
  encoding: "utf-8",
}.freeze
ENDIANDED_INTEGER_COMMAND_MAP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

A map of endianded integer commands to Array#pack formats.

{
  u16: "S",
  u32: "L",
  u64: "Q",
  i16: "s",
  i32: "l",
  i64: "q",
}.freeze