@@ -25,7 +25,6 @@ Cpptrace also has a C API, docs [here](docs/c-api.md).
25
25
- [ Utilities] ( #utilities )
26
26
- [ Formatting] ( #formatting )
27
27
- [ Transforms] ( #transforms )
28
- - [ Formatting Utilities] ( #formatting-utilities )
29
28
- [ Configuration] ( #configuration )
30
29
- [ Logging] ( #logging )
31
30
- [ Traces From All Exceptions (` CPPTRACE_TRY ` and ` CPPTRACE_CATCH ` )] ( #traces-from-all-exceptions-cpptrace_try-and-cpptrace_catch )
@@ -300,8 +299,14 @@ namespace cpptrace {
300
299
301
300
`cpptrace::demangle` is a helper function for name demangling, since it has to implement that helper internally anyways.
302
301
303
- `cpptrace::prune_symbol` is a helper function that prunes demangled symbols by removing return types, template
304
- arguments, and function parameters. It also does some minimal normalization. For example, it prunes
302
+ `cpptrace::basename` is a helper for custom formatters that extracts a base file name from a path.
303
+
304
+ `cpptrace::prettify_symbol` is a helper for custom formatters that applies a number of transformations to clean up long
305
+ symbol names. For example, it turns `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >`
306
+ into `std::string`.
307
+
308
+ `cpptrace::prune_symbol` is a helper for custom formatters that prunes demangled symbols by removing return types,
309
+ template arguments, and function parameters. It also does some minimal normalization. For example, it prunes
305
310
`ns::S<int, float>::~S()` to `ns::S::~S`.
306
311
307
312
`cpptrace::get_snippet` gets a text snippet, if possible, from for the given source file for +/- `context_size` lines
@@ -315,13 +320,19 @@ stack trace from a cpptrace exception (more info below) and otherwise behaves li
315
320
```cpp
316
321
namespace cpptrace {
317
322
std::string demangle(const std::string& name);
323
+
324
+ std::string basename(const std::string& path);
325
+
326
+ std::string prettify_symbol(std::string symbol);
318
327
std::string prune_symbol(const std::string& symbol);
328
+
319
329
std::string get_snippet(
320
330
const std::string& path,
321
331
std::size_t line,
322
332
std::size_t context_size,
323
333
bool color = false
324
334
);
335
+
325
336
bool isatty(int fd);
326
337
327
338
extern const int stdin_fileno;
@@ -434,18 +445,6 @@ auto formatter = cpptrace::formatter{}
434
445
});
435
446
```
436
447
437
- ### Formatting Utilities
438
-
439
- Cpptrace exports a couple formatting utilities used internally which might be useful for custom formatters that don't
440
- use `cpptrace::formatter`:
441
-
442
- ```cpp
443
- namespace cpptrace {
444
- std::string basename(const std::string& path);
445
- std::string prettify_symbol(std::string symbol);
446
- }
447
- ```
448
-
449
448
## Configuration
450
449
451
450
`cpptrace::absorb_trace_exceptions`: Configure whether the library silently absorbs internal exceptions and continues.
0 commit comments