- Introduce the `std::string Format(std:string)` method
- Simplify the algorithm to use `cmTokenizedView()` instead of pointers manipulation and slow iostreams
- Formatted text chunks are collected as a sequence of string views to join once at the end
- Refactor and optimize the loop to make it shorter and faster
- Make it push elements into an arbitrary (templated) output iterator
- Make it a template on a separator type with the most used defaults
- Add a backward compatible signature to return `std::vector<std::string>`
- Add an alternative function `cmTokenizedView()` to return a vector of string views
Create a `cm::PathResolver` helper to compute normalized paths.
Provide a common implementation with compile-time dispatch to
select details w.r.t. symbolic links, existence, and matching
the on-disk case of existing paths. Later we can use this to
implement:
* `ToNormalizedPathOnDisk`: Normalizes paths while resolving symlinks
only when followed by `..` components. Does not require paths to
exist, but reads on-disk case of paths that do exist (on Windows).
* `GetRealPath`: Normalizes paths while resolving all symlinks.
Requires paths to exist, and reads their on-disk case (on Windows).
* `CollapseFullPath`: Normalizes paths in memory without disk access.
Assumes components followed by `..` components are not symlinks.
Abstract filesystem access through runtime dispatch so that we can test
Windows symbolic link and network path behavior without relying on real
environments. The overhead of runtime dispatch should be insignificant
during real filesystem access.
Issue: #16228
Issue: #17206
Add support for the "format" property of the Debug Adapter Protocol
StackTrace request to fulfill the host's request to format the resulting
StackFrame name differently.
Backport changes from libuv v2 commit `8ad246557a` (win,process: allow
users to configure child error mode, 2024-10-17) to add the
`UV_PROCESS_WINDOWS_USE_PARENT_ERROR_MODE` option.
Also use `UV_PROCESS_WINDOWS_USE_PARENT_ERROR_MODE` to keep
the behavior the same as before the option was added,
all child processes would be spawned the the parent's
error mode.
Issue: #20115
Iterate over the object's members and call a filter callable to decide what
to do with the current key/value. A filter returns one of the `FilterResult`
values. A container type is an associative or a sequence container of pairs
(key, value).
Refactor `MapFilter()` and `Map()` to use `FilteredObject()`. Moreover,
for C++ >= 17 implementation is more optimized depending on the given filter
object type and capable of detecting and properly calling the filter callable
using 1 or 3 arguments, up to totally eliminate any checking (even dummy)
in the generated code.
Supported container types, used to append key/value items, aren't limited to
`std::map` only and can be any associative container or a sequenced one with
pairs of key/value as elements.
Performs `==` on given arguments and print an error if they are
not equal also printing their values.
Both arguments must be printable to `std::ostream`!
The operator added by commit 17690558c3 (cmUVHandlePtr: Add explicit
conversion to bool, 2023-10-26) works in direct expressions like
`if(foo)` but not compound expressions like `if(foo && ...)`.
Drop the `explicit` mark when compiling with Oracle Studio so we
can at least compile valid code.
This provides a utility macro which prints out:
- location of the call;
- the expression being evaluated; and
- the value of the expression.
Evaluates to the value of the expression.
Inspired by Rust's `dbg!` macro.
See: https://doc.rust-lang.org/stable/std/macro.dbg.html
Remove libuv usage from CMake debugger. Libuv has an async io model
and cppdap uses a sync model, so an extra thread and a buffer copy
were necessary to match semantics. In order to eliminate those
costs this commit implements the IO using platform specific APIs.