Latest version:
Tramway SDK 0.0.9
Github
Quick links
Home
Get Started

File


This is a file abstraction that I made. I made it because the filestream of the C++ standard library, altough possesing a very je ne sais quoi interface, is way too slow.

Currently it can only be used to load text files and parse them from disk.

I will probably add some more stuff to it in the future, like accessing files over HTTP instead of just from disk, or maybe loading them from .zip files.

Programming in C++


#include <framework/file.h>
API documentation page.

This is how you can parse in some text files.

File file("my-text-file.txt", MODE_READ);

printf("num1: %f\n", file.read_float32());
printf("num2: %i\n", file.read_int32());

// read until end of file
while (file.is_continue()) {
    printf("%s\n", file.read_name());
}

Check render/model.cpp and render/sprite.cpp for more examples of how you can use this.