Skip to content

C++ class: TreeRow

Index · Français

Description

Visible DirectoryTree row.

Qualified name : gaspardos::desktop::TreeRow.

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

When to use it

Display a directory depth and expansion state.

Simple program example

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

int main()
{
    gaspardos::desktop::TreeRow row;
    row.depth           = 0;
    row.expanded        = false;
    row.entry.name      = "AHCIDISK0";
    row.entry.directory = true;
    return row.depth == 0 && row.entry.directory ? 0 : 1;
}

Building from Windows

Save the program above as build/api-examples/TreeRow.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/TreeRow.cpp -o build/api-examples/TreeRow-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

No declared methods; aggregate type.

Public data

entry : FileEntry ; depth : unsigned ; expanded : bool. Aggregate: initialize depth and expanded explicitly.