Skip to content

Repository files navigation

NBT

A modern, fast, and type-safe C++ library for reading, writing, and manipulating Named Binary Tag (NBT) data.

C++


Features

  • Fully typed tag system
  • Read & write support for NBT
  • Supports multiple formats via NbtFormat (e.g. Little Endian)
  • Clean template-based architecture

Library Example

cubix::BinaryStream stream{};

using NbtLE = Nbt::NbtContext<Nbt::NbtFormat::LittleEndian>;

NbtLE::CompoundTag compound{};
compound.add("int8", NbtLE::ByteTag(1));

// Write
std::ignore = NbtLE::writeRoot(stream, tag.copy());

// Read
const auto result = NbtLE::readRoot(stream);
if (!result) {
    return 1;
}

std::println("{}", result.value()->toString());

Installation (CMake)

FetchContent_Declare(
    NBT
    GIT_REPOSITORY https://github.com/Cubix-Engine/NBT.git
    GIT_TAG main
)

FetchContent_MakeAvailable(NBT)

target_link_libraries(your_target PRIVATE NBT::nbt)

License

This project is open-source under the MIT License. Feel free to modify and contribute!

Contributing

# Fork the repository on GitHub, then:
git clone https://github.com/<your-username>/NBT.git

# Create a new branch
git checkout -b feature-branch

# Commit your changes
git commit -m "Added new feature"

# Push to GitHub
git push origin feature-branch

# Submit a Pull Request

About

A modern, fast, and type-safe C++ library for reading, writing, and manipulating Named Binary Tag (NBT) data.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages