Headers move, CMake targets merge, C++ namespaces stay unchanged: - Core: Scope, Lazy, Counted, Flags, Hash, Bits, Uuid, TypeList, TypeMap, Variant - Functional: Pipeline, Either, Result, Retry - Containers: Ring, Pool, PriorityQueue, LRU, Trie, Graph, DisjointSet, Bitset, Interval - Math: +Matrix, Numeric, Random, Histogram - Text: Str, Format, Tokenizer, Diff, Encoding, Semver - Data: Json, Csv, Ini - Async: Coro, Concurrency, EventBus, Observable - Time: +Bench - Log: Log facade + Logging framework (facade now header-only, breaking the Stacktrace<->Log link cycle the merge would have created) - System: FileSystem + Process - Configuration: +Argparse - Unchanged: Stacktrace, Plugin, StateMachine, Testing, TestingMock, Detail Module system fixes: - OPTIONAL_DEPS resolution deferred to void_finalize_modules() so it no longer depends on the alphabetical discovery order of src/ subdirs (Testing -> Text would have been silently dropped). - Every header-only module now has a tracked module.cmake; previously the empty src/<Name> marker dirs were untracked, so a fresh clone would have silently skipped those modules. - VOID_HAS_LOGGING/CONCURRENCY/STR consumers renamed to LOG/ASYNC/TEXT. Tests move to tests/standalone/<Umbrella>/<Feature>.cpp (Result suite files prefixed: ResultBasic etc.). Test count verified identical (831) before and after. README/CLAUDE.md module tables updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
32 lines
1012 B
C++
32 lines
1012 B
C++
#pragma once
|
|
#include <Void/Functional/Error.hpp>
|
|
#include <Void/Functional/Result.hpp>
|
|
#include <ostream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Void::Stacktrace
|
|
{
|
|
struct StackFrame {
|
|
std::string function_name;
|
|
std::string source_file;
|
|
int source_line{0};
|
|
std::string source_snippet;
|
|
};
|
|
|
|
std::vector<StackFrame> capture_stacktrace(unsigned skip_frames = 0,
|
|
unsigned max_frames = 32);
|
|
|
|
/// Read a snippet of source around `line`. On failure (file missing,
|
|
/// not readable, etc.) returns Failure<Error> instead of an empty
|
|
/// string — callers that want the silent fallback can still do
|
|
/// `read_source_snippet(...).value_or("")`.
|
|
Void::Result::Result<std::string, Void::Result::Error>
|
|
read_source_snippet(const std::string& file, int line,
|
|
int context_lines = 3);
|
|
|
|
std::string format_stacktrace(const std::vector<StackFrame>& frames);
|
|
void print_stacktrace(std::ostream& os,
|
|
const std::vector<StackFrame>& frames);
|
|
} // namespace Void::Stacktrace
|