package mlgpx

  1. Overview
  2. Docs
Library and CLI for parsing and generating GPS Exchange (GPX) formats

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mlgpx-1.0.0.tbz
md5=5342bb7e601273245a9fe263e5a08770
sha512=cd73b16e988b3ed3cc427a6c6c6d6c9c745adb1eb7efaae3c34e8d006e9c03d9f9d2616cd4118564bd9873903969d3e4053b585e79dbd3e3e7d0f541e2faac83

doc/mlgpx.eio/Gpx_eio/IO/index.html

Module Gpx_eio.IOSource

GPX Eio I/O operations

This module provides GPX I/O operations using Eio's effects-based concurrent I/O system. All operations are structured concurrency compatible and work with Eio's resource management.

File Operations

Sourceval read_file : ?validate:bool -> fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> Gpx.t

Read GPX from file path.

  • parameter fs

    Filesystem capability

  • parameter path

    File path to read

  • parameter ?validate

    Optional validation flag (default: false)

  • returns

    GPX document or error

Sourceval write_file : ?validate:bool -> fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> Gpx.t -> unit

Write GPX to file path.

  • parameter fs

    Filesystem capability

  • parameter path

    File path to write

  • parameter gpx

    GPX document to write

  • parameter ?validate

    Optional validation flag (default: false)

Stream Operations

Read/write GPX from/to Eio flows.

Sourceval read_source : ?validate:bool -> [> Eio.Flow.source_ty ] Eio.Resource.t -> Gpx.t

Read GPX from Eio source.

  • parameter source

    Input flow to read from

  • parameter ?validate

    Optional validation flag (default: false)

  • returns

    GPX document

Sourceval write_sink : ?validate:bool -> [> Eio.Flow.sink_ty ] Eio.Resource.t -> Gpx.t -> unit

Write GPX to Eio sink.

  • parameter sink

    Output flow to write to

  • parameter gpx

    GPX document to write

  • parameter ?validate

    Optional validation flag (default: false)

Utility Functions

Sourceval file_exists : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> bool

Check if file exists.

  • parameter fs

    Filesystem capability

  • parameter path

    File path to check

  • returns

    true if file exists and is readable

Sourceval file_size : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> int

Get file size.

  • parameter fs

    Filesystem capability

  • parameter path

    File path

  • returns

    File size in bytes

Sourceval create_backup : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> string

Create backup of existing file.

  • parameter fs

    Filesystem capability

  • parameter path

    Original file path

  • returns

    Backup file path

Sourceval write_file_with_backup : ?validate:bool -> fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> Gpx.t -> string

Write GPX to file with automatic backup. Creates a backup of existing file before writing new content.

  • parameter fs

    Filesystem capability

  • parameter path

    File path to write

  • parameter gpx

    GPX document to write

  • parameter ?validate

    Optional validation flag (default: false)

  • returns

    Backup file path (empty string if no backup needed)