summaryrefslogtreecommitdiffstats
path: root/Source/cmStringCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmStringCommand: remove use of cmCatViews()Kyle Edwards2022-11-291-32/+32
|
* string(JSON): Fix typo in error messageSean Kahler2022-08-041-1/+1
| | | | `s/then/than/` in a comparison.
* Source: Replace uses of sprintf with safer snprintfSean McBride2022-06-221-1/+2
|
* string(): Support hash functions in bootstrapKyle Edwards2022-04-211-5/+0
| | | | | cmCryptoHash has been included in the bootstrap script since 596439b. Add hash support to string() in bootstrap to allow FindPython to work.
* string(JSON): fix error message on invalid modeCarlo Teubner2022-03-301-2/+2
| | | | | | | 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.
* Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-1/+1
|
* Source: Fix clang -Wextra-semi warningsSean McBride2021-09-281-1/+1
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-2/+2
|
* Source: Reduce c_str() usagevvs314152021-03-131-2/+2
|
* clang-tidy: fix `bugprone-reserved-identifier` warningsBen Boeckel2021-01-271-0/+1
|
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-6/+6
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* string(JSON): Adds JSON parsing support to the string commandPeter Steneteg2020-09-161-0/+300
| | | | | | | 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
* cmStringAlgorithms: Add faster cmJoin overloads for stringsOleksandr Koval2020-09-031-4/+8
| | | | | | | 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().
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-7/+4
|
* Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
|
* string: Add new HEX sub-commandKyle Edwards2020-02-191-0/+22
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-1/+2
| | | | | 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.
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-2/+2
| | | | | | | | | | | | | | 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
* Refactor: Use cmStrCat to construct error stringsAsit Dhal2019-09-181-23/+9
| | | | | Replace string construction using std::stringstream with cmStrCat and cmWrap.
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-3/+3
|
* Merge topic 'string-subcommand-table'Brad King2019-08-261-130/+65
|\ | | | | | | | | | | | | 66c2714f22 cmStringCommand: Use cmSubcommandTable Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3721
| * cmStringCommand: Use cmSubcommandTableRegina Pfeifer2019-08-221-130/+65
| |
* | Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-6/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)`
* cmCommand refactor: cmStringCommandGabor Bencze2019-08-201-166/+237
|
* cmCryptoHash: Accept cm::string_view inputSebastian Holtermann2019-08-181-1/+1
|
* Merge topic 'cmStringAlgorithms_ulong'Kyle Edwards2019-08-161-1/+1
|\ | | | | | | | | | | | | 935fbe0b04 cmStringAlgorithms: Add cmStrToLong and cmStrToULong Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3681
| * cmStringAlgorithms: Add cmStrToLong and cmStrToULongSebastian Holtermann2019-08-101-1/+1
| | | | | | | | | | | | | | | | 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.
* | Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-2/+2
|/
* cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* cmMakefile: Let AddDefinition accept a value as cm::string_viewSebastian Holtermann2019-07-241-21/+20
| | | | | | | | | | | | | | | | 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.
* modernize: manage cmCommand instances using unique_ptr.Marc Chevrier2019-07-141-1/+0
|
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | 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.
* string: introduce `REPEAT` sub-commandAlex Turbov2019-04-151-0/+61
|
* cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-0/+1
|
* Prefer front/back/data over dereferencing begin/rbegin iterArtur Ryt2019-02-061-1/+1
| | | | Changed for sequenced containers: vector, list, string and array
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-4/+3
|
* Remove unnecessary c_str() in RegularExpression::find callsVitaly Stakhovsky2018-08-071-1/+1
|
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-4/+4
| | | | | | | | | | | | 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.
* string() Refactoring: creates an helper for REGEX REPLACEMarc Chevrier2018-04-161-86/+14
|
* string: Add JOIN subcommandAlex Turbov2018-02-161-2/+23
| | | | | This is just like CONCAT but accepts a glue string to put between each value. `JOIN ""` is equivalent to `CONCAT`.
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-3/+3
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-4/+4
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* Replace C-style castsDaniel Pfeifer2017-08-271-1/+1
|
* Add PREPEND sub-command to string commandSylvain Joubert2017-08-111-0/+27
|
* cmStringCommand: clear intermediate matchesBen Boeckel2017-07-211-0/+2
| | | | | | | | | | | 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.
* Add const-reference qualificationsPavel Solodovnikov2017-05-261-11/+11
|
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | 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'
* clang-tidy: apply readability-redundant-string-init fixesDaniel Pfeifer2016-12-121-1/+1
|
* clang-tidy: apply performance-faster-string-find fixesDaniel Pfeifer2016-12-121-1/+1
|
* string: Add support for SHA-3 algorithmsBrad King2016-11-101-1/+3
|