Package 'toonfmt'

Title: R Bindings for TOON Format
Description: Provides R bindings for reading and writing TOON (Token-Oriented Object Notation) format files. TOON is a lightweight, human-readable data serialization format. This package uses Rust for fast parsing and encoding.
Authors: Dyfan Jones [aut, cre]
Maintainer: Dyfan Jones <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2026-05-25 06:10:25 UTC
Source: https://github.com/DyfanJones/toonfmt

Help Index


Parse TOON data from connection and return the parsed data as an R object.

Description

Parse TOON data from connection and return the parsed data as an R object.

Usage

read_toon_conn(conn, strict = TRUE, coerce_types = TRUE, int64 = "double")

Arguments

conn

A connection object (e.g., from file(), url(), gzfile(), etc.)

strict

Use strict mode for parsing (default: true)

coerce_types

Enable automatic type coercion (default: true)

int64

How to handle large integers: "double" (default), "string", or "bit64"


Read a TOON file and return the parsed data as an R object.

Description

Read a TOON file and return the parsed data as an R object.

Usage

read_toon_file(path, strict = TRUE, coerce_types = TRUE, int64 = "double")

Arguments

path

Path to the TOON file

strict

Use strict mode for parsing (default: true)

coerce_types

Enable automatic type coercion (default: true)

int64

How to handle large integers: "double" (default), "string", or "bit64"


Parse TOON data from raw bytes and return the parsed data as an R object.

Description

Parse TOON data from raw bytes and return the parsed data as an R object.

Usage

read_toon_raw(raw_bytes, strict = TRUE, coerce_types = TRUE, int64 = "double")

Arguments

raw_bytes

Raw bytes containing TOON format data

strict

Use strict mode for parsing (default: true)

coerce_types

Enable automatic type coercion (default: true)

int64

How to handle large integers: "double" (default), "string", or "bit64"


Parse a TOON string and return the parsed data as an R object.

Description

Parse a TOON string and return the parsed data as an R object.

Usage

read_toon_str(toon_str, strict = TRUE, coerce_types = TRUE, int64 = "double")

Arguments

toon_str

TOON format string

strict

Use strict mode for parsing (default: true)

coerce_types

Enable automatic type coercion (default: true)

int64

How to handle large integers: "double" (default), "string", or "bit64"


Write an R object to a TOON file.

Description

Write an R object to a TOON file.

Usage

write_toon_file(data, path, delimiter = ",", pretty = FALSE)

Arguments

data

R object to encode (list, vector, etc.)

path

Path where the TOON file will be written

delimiter

Delimiter character: c(",", "|", "\t") (default: ",")

pretty

Use pretty formatting with default indentation (default: FALSE)


Convert an R object to TOON format and return as raw bytes.

Description

Convert an R object to TOON format and return as raw bytes.

Usage

write_toon_raw(data, delimiter = ",", pretty = FALSE)

Arguments

data

R object to encode (list, vector, etc.)

delimiter

Delimiter character: c(",", "|", "\t") (default: ",")

pretty

Use pretty formatting with default indentation (default: FALSE)


Convert an R object to a TOON format string.

Description

Convert an R object to a TOON format string.

Usage

write_toon_str(data, delimiter = ",", pretty = FALSE)

Arguments

data

R object to encode (list, vector, etc.)

delimiter

Delimiter character: c(",", "|", "\t") (default: ",")

pretty

Use pretty formatting with default indentation (default: FALSE)