locus_mmdb_data_codec (locus v2.3.14)

View Source

API for working with MMDB - data codec

Summary

Functions

Attempts to parse either the Value or RawValue (depending on the Raw flag) at Index in DataSection.

Types

index/0

-type index() :: non_neg_integer().

validation_aux/0

-type validation_aux() ::
          #validation_aux{indices_in_tree :: locus_shared_bitarray:t(),
                          visited :: locus_shared_bitarray:t(),
                          valid_map_keys :: locus_shared_bitarray:t(),
                          batch_size :: pos_integer(),
                          data :: binary(),
                          journal :: locus_mmdb_check_journal:t()}.

Functions

parse_on_index(Index, DataSection, Raw)

-spec parse_on_index(Index, DataSection, Raw) -> {Value | RawValue, RemainingData}
                        when
                            Index :: index(),
                            DataSection :: binary(),
                            Raw :: boolean(),
                            Value :: locus_mmdb_data:value(),
                            RawValue :: locus_mmdb_data_raw:value(),
                            RemainingData :: binary().

Attempts to parse either the Value or RawValue (depending on the Raw flag) at Index in DataSection.

Will crash upon invalid/unrecognized data, invalid pointers or cyclic pointer chasing (i.e. loops.)