Some checks failed
CI / build-test-release (push) Failing after 5m36s
Canonical LGPL-3.0-only text, GPL-3.0 companion, SPDX headers on all first-party sources, MIT for examples/. Vendored lib/ untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
41 lines
1.4 KiB
C++
41 lines
1.4 KiB
C++
//SPDX-License-Identifier: LGPL-3.0-only
|
|
//SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
|
|
|
module;
|
|
#include "Crafter.Build-Api.h"
|
|
export module Crafter.Build:Progress;
|
|
import std;
|
|
|
|
export namespace Crafter::Progress {
|
|
enum class Verbosity { Quiet, Default, Verbose };
|
|
|
|
CRAFTER_API void SetVerbosity(Verbosity v);
|
|
CRAFTER_API Verbosity GetVerbosity();
|
|
|
|
// RAII work-unit marker. Construction inflates the running total; destruction
|
|
// increments completed and (on Default + TTY) redraws the status line. Move
|
|
// semantics are disabled — keep these as plain stack locals inside the worker
|
|
// lambda so the destructor fires when that thread's work ends.
|
|
class CRAFTER_API Task {
|
|
public:
|
|
explicit Task(std::string label);
|
|
~Task();
|
|
Task(const Task&) = delete;
|
|
Task& operator=(const Task&) = delete;
|
|
Task(Task&&) = delete;
|
|
Task& operator=(Task&&) = delete;
|
|
private:
|
|
std::string label_;
|
|
};
|
|
|
|
// Verbose-mode command echo. No-op outside Verbose.
|
|
CRAFTER_API void EchoCommand(std::string_view command);
|
|
|
|
// Erase the in-place status line so subsequent stderr writes (errors,
|
|
// banners) don't collide with it. No-op when not in TTY-redraw mode.
|
|
CRAFTER_API void Clear();
|
|
|
|
// Print "Built N targets in Xms" (or equivalent) and clear in-place state.
|
|
// Safe to call multiple times; subsequent calls are no-ops.
|
|
CRAFTER_API void Finalize();
|
|
}
|