Skip to content

C++ class: FileEntry

Index · Français

Description

UTF-8 filesystem entry.

Qualified name : gaspardos::desktop::FileEntry.

Header : bindings/cpp/file_explorer.hpp. C++98.

When to use it

Carry metadata and path between backend and UI.

Simple program example

#include "file_explorer.hpp"
#include <cstdio>
#include <cstring>

int main()
{
    gaspardos::desktop::FileEntry entry;
    entry.name = "readme.txt";
    entry.path = "/AHCIDISK0/readme.txt";
    std::printf("%s\n", entry.path.c_str());
    return entry.directory || entry.bytes != 0 ? 1 : 0;
}

Building from Windows

Save the program above as build/api-examples/FileEntry.cpp from the repository root. Create the directory if necessary.

PowerShell — from the repository root:

New-Item -ItemType Directory -Force build/api-examples | Out-Null
& .\build-x64-install\bin\x86_64-gaspardos-g++.exe -std=c++98 -O2 -Ibindings/cpp build/api-examples/FileEntry.cpp -o build/api-examples/FileEntry-x64.elf
if ($LASTEXITCODE -ne 0) { throw "C++ compilation/link failed" }

Run the ELF on GaspardOS, not Windows. The driver supplies CRT and libraries. Prepare the required volumes/services; examples bound their waits and may exit on backpressure rather than retry. Successful compilation does not validate kernel execution.

The headers, implementation files, native wrappers and complete examples are available under Source files.

Class methods

FileEntry()

Initialize directory=false and bytes=0; empty strings.

Public data

name, path : string ; directory : bool ; bytes : uint64_t.