Skip to content

starlet-engine/serializer

Repository files navigation

Starlet Serializer

Tests C++20 License: MIT

A lightweight serialization library for Starlet projects to handle both data reading and writing.

Features

File Format Support

  • Images:
    • BMP (24-bit)
    • TGA (24/32-bit uncompressed)
  • Meshes:
    • PLY (ASCII w/ positions, normals, colors, texture coordinates)
    • OBJ (positions, normals, texture coordinates, vertex colors, n-gon triangulation)
  • Scenes: Custom text-based scene format with models, lights, cameras, textures, primitives

Core Utilities

  • File I/O: Binary and text file loading
  • Parsing Primitives:
    • Type-safe parsers: parseBool, parseUInt, parseFloat, parseVec2f/3f/4f
    • Token extraction with parseToken
    • Whitespace handling: skipWhitespace, skipToNextLine, trimEOL
    • Error-safe macros: STARLET_PARSE_OR, STARLET_PARSE_STRING_OR

Dependencies

Installation

Prerequisites

  • C++20 or later
  • One of the following Build Systems,
    • CMake 3.20+
    • Meson 1.1+

Using as a Dependency

CMake

include(FetchContent)

FetchContent_Declare(starlet_serializer
  GIT_REPOSITORY https://github.com/starlet-engine/serializer.git 
  GIT_TAG main
)
FetchContent_MakeAvailable(starlet_serializer)

target_link_libraries(app_name PRIVATE starlet_serializer)

Meson

Note: Meson does not fetch dependencies automatically. Add the starlet_serializer.wrap file to your project's subprojects directory.

In your meson.build:

starlet_serializer = subproject('starlet_serializer')
starlet_serializer_dep = starlet_serializer.get_variable('starlet_serializer_dep')
executable('app_name', 'main.cpp', dependencies: starlet_serializer_dep)

Building and Testing

git clone https://github.com/starlet-engine/serializer.git
cd serializer

CMake

cmake -B build -DBUILD_TESTS=ON
cmake --build build
ctest --test-dir build

Meson

meson setup build -Dbuild_tests=true
meson compile -C build
meson test -C build

License

MIT License - see LICENSE for details.

About

Lightweight serialization library for Starlet projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors