| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
`s/then/than/` in a comparison.
|
| |
|
|
|
|
|
| |
cmCryptoHash has been included in the bootstrap script since 596439b.
Add hash support to string() in bootstrap to allow FindPython to work.
|
|
|
|
|
|
|
| |
The `GET_ARRAY` and `MEMBERS` modes were removed during development and
review of commit 8eab76eb84 (string(JSON): Adds JSON parsing support to
the string command, 2020-08-24, v3.19.0-rc1~159^2), but were
accidentally left in an error message.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
CMake uses explicit 'this->' style. Using custom clang-tidy check we can
detect and fix places where 'this->' was missed.
|
|
|
|
|
|
|
| |
Adds a set of sub commands to the string command for parsing JSON, the
JSON commands are: GET, TYPE, MEMBER, LENGTH, REMOVE, SET, and EQUAL.
Closes: #19501
|
|
|
|
|
|
|
| |
cmJoin() is often used with std::string ranges. Generic implementation
uses std::ostringstream which is not optimal. With strings we can avoid
operator<<() and make much faster implementation. Additional 'initial'
argument is useful for cmStringCommand.cxx:HandleAppendCommand().
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`. Use `clang-format` version 6.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones. For example:
#include <cm/string_view>
can be used safely for CMake development in place of the `<string_view>`
standard header.
Fixes: #19491
|
|
|
|
|
| |
Replace string construction using std::stringstream with cmStrCat and
cmWrap.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
66c2714f22 cmStringCommand: Use cmSubcommandTable
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3721
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is generated by a python script that uses regular expressions to
search for string concatenation patterns of the kind
```
std::string str = <ARG0>;
str += <ARG1>;
str += <ARG2>;
...
```
and replaces them with a single `cmStrCat` call
```
std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...);
```
If any `<ARGX>` is itself a concatenated string of the kind
```
a + b + c + ...;
```
then `<ARGX>` is split into multiple arguments for the `cmStrCat` call.
If there's a sequence of literals in the `<ARGX>`, then all literals in the
sequence are concatenated and merged into a single literal argument for
the `cmStrCat` call.
Single character strings are converted to single char arguments for
the `cmStrCat` call.
`std::to_string(...)` wrappings are removed from `cmStrCat` arguments,
because it supports numeric types as well as string types.
`arg.substr(x)` arguments to `cmStrCat` are replaced with
`cm::string_view(arg).substr(x)`
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3681
|
| |
| |
| |
| |
| |
| |
| |
| | |
This adds the following functions to cmStringAlgorithms:
- `cmStrToLong`: moved from `cmSystemTools::StringToLong`
- `cmStrToULong`: moved from `cmSystemTools::StringToULong`
Overloads of the given functions for `std::string` are added as well.
|
|/ |
|
|
|
|
|
| |
This adds the `cmStringAlgorithms.h` header and moves all string functions
from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes `cmMakefile::AddDefinition` to take a `cm::string_view` as value
argument instead of a `const char *`.
Benefits are:
- `std::string` can be passed to `cmMakefile::AddDefinition` directly without
the `c_str()` plus string length recomputation fallback.
- Lengths of literals passed to `cmMakefile::AddDefinition` can be computed at
compile time.
In various sources uses of `cmMakefile::AddDefinition` are adapted to avoid
`std::string::c_str` calls and the `std::string` is passed directly.
Uses of `cmMakefile::AddDefinition`, where a `nullptr` `const char*` might
be passed to `cmMakefile::AddDefinition` are extended with `nullptr` checks.
|
| |
|
|
|
|
|
|
|
|
| |
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints. Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
|
| |
|
| |
|
|
|
|
| |
Changed for sequenced containers: vector, list, string and array
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`. Use `clang-format` version 6.0.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
|
| |
|
|
|
|
|
| |
This is just like CONCAT but accepts a glue string to put between
each value. `JOIN ""` is equivalent to `CONCAT`.
|
|
|
|
| |
Signed-off-by: Matthias Maennich <matthias@maennich.net>
|
|
|
|
|
|
| |
Changes done via `clang-tidy` with some manual fine-tuning
for the variable naming and `auto` type deduction
where appropriate.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When `string(REGEX REPLACE)` or `string(REGEX MATCHALL)` loop
internally, they store their matches, but they do not clear the previous
match from an earlier iteration. This can leave the contents of
`CMAKE_MATCH_<N>` with bogus values for later matches in the string if
they have groups which earlier matched a non-empty string, but now match
an empty string.
Fixes #17079.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automate with:
git grep -l '#include <cm_' -- Source \
| xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'
git grep -l '#include <cmsys/' -- Source \
| xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'
git grep -l '#include <cm[A-Z]' -- Source \
| xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
|
| |
|
| |
|
| |
|