mmm-0.1.0.0: Minecraft 1.21.4 implementation in Haskell
Copyright(c) axionbuster 2025
LicenseBSD-3-Clause
Safe HaskellNone
LanguageGHC2021

M.NBT.Internal.JS

Description

Implements Java's Modified UTF-8 (CESU-8) encoding and decoding for string handling in NBT format.

See: https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html#modified-utf-8

Synopsis

Documentation

newtype JS Source #

Java's CESU-8 encoding/decoding

this newtype is purely for modulation of encoding and decoding. it is not intended to be used directly in the public API

use textascesu8 and cesu8astext to convert between Text and ByteString

see:

Constructors

JS 

Fields

Instances

Instances details
Data JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JS -> c JS #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JS #

toConstr :: JS -> Constr #

dataTypeOf :: JS -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JS) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JS) #

gmapT :: (forall b. Data b => b -> b) -> JS -> JS #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JS -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JS -> r #

gmapQ :: (forall d. Data d => d -> u) -> JS -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> JS -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> JS -> m JS #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JS -> m JS #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JS -> m JS #

IsString JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

fromString :: String -> JS #

Generic JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Associated Types

type Rep JS 
Instance details

Defined in M.NBT.Internal.JS

type Rep JS = D1 ('MetaData "JS" "M.NBT.Internal.JS" "mmm-0.1.0.0-oCDsNp3EBL2JzoyA6cTai" 'True) (C1 ('MetaCons "JS" 'PrefixI 'True) (S1 ('MetaSel ('Just "getjs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: JS -> Rep JS x #

to :: Rep JS x -> JS #

Read JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Show JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

showsPrec :: Int -> JS -> ShowS #

show :: JS -> String #

showList :: [JS] -> ShowS #

NFData JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

rnf :: JS -> () #

Eq JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

(==) :: JS -> JS -> Bool #

(/=) :: JS -> JS -> Bool #

Ord JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

compare :: JS -> JS -> Ordering #

(<) :: JS -> JS -> Bool #

(<=) :: JS -> JS -> Bool #

(>) :: JS -> JS -> Bool #

(>=) :: JS -> JS -> Bool #

max :: JS -> JS -> JS #

min :: JS -> JS -> JS #

Hashable JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

hashWithSalt :: Int -> JS -> Int

hash :: JS -> Int

Pack JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

pack :: JS -> Builder Source #

Unpack JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

unpack :: forall (st :: ZeroBitType) r. Parser st r JS Source #

Lift JS Source # 
Instance details

Defined in M.NBT.Internal.JS

Methods

lift :: Quote m => JS -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => JS -> Code m JS #

type Rep JS Source # 
Instance details

Defined in M.NBT.Internal.JS

type Rep JS = D1 ('MetaData "JS" "M.NBT.Internal.JS" "mmm-0.1.0.0-oCDsNp3EBL2JzoyA6cTai" 'True) (C1 ('MetaCons "JS" 'PrefixI 'True) (S1 ('MetaSel ('Just "getjs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

tocesu8 :: JS -> ByteString Source #

encode text to CESU-8

tocesu8p :: JS -> Builder Source #

encode text to CESU-8 (Builder version)

fromcesu8 :: ByteString -> Maybe JS Source #

decode CESU-8 encoded text

fromcesu8p :: forall (st :: ZeroBitType) r. Parser st r JS Source #

decode CESU-8 encoded text (Parser version)