summaryrefslogtreecommitdiffstats
path: root/Source/cmStringCommand.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-1/+0
|
* Include necessary headers in commandsDaniel Pfeifer2016-10-261-9/+14
|
* Separate compilation for commands included in cmBootstrapCommands2Daniel Pfeifer2016-10-211-0/+1
|
* Simplify CMake per-source license noticesBrad King2016-09-271-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Avoid else after returnDaniel Pfeifer2016-09-161-24/+46
|
* use empty method to check for emptynessDaniel Pfeifer2016-09-151-1/+1
|
* Add additional <= and >= comparison operatorsChuck Atkins2016-08-091-1/+6
| | | | | This adds the LESS_EQUAL, GREATER_EQUAL, and associated STR and VERSION equivalents to use the combined <= and >= functionality.
* Avoid using KWSys auto_ptr by adopting it ourselvesBrad King2016-06-291-1/+1
| | | | | | | | | | | | Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to our own implementation adopted from the KWSys auto_ptr implementation. Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers that do not warn about it. Automate the client site conversions: git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \ 's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-462/+275
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Remove `//------...` horizontal separator commentsBrad King2016-05-091-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | Modern editors provide plenty of ways to visually separate functions. Drop the explicit comments that previously served this purpose. Use the following command to automate the change: $ git ls-files -z -- \ "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" | egrep -z -v "^Source/cmCommandArgumentLexer\." | egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmDependsJavaLexer\." | egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmExprLexer\." | egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmFortranLexer\." | egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" | egrep -z -v "^Source/cmListFileLexer\." | egrep -z -v "^Source/cm_sha2" | egrep -z -v "^Source/(kwsys|CursesDialog/form)/" | egrep -z -v "^Utilities/(KW|cm).*/" | xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}' This avoids modifying third-party sources and generated sources.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source: Stabilize include orderBrad King2016-04-291-0/+1
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Fix spelling typos in comments and documentation (#16037)Felix Geyer2016-03-291-1/+1
| | | | | The Debian package checker tool (lintian) detected several typos in CMake.
* cmAlgorithms: Rename cmRange to cmMakeRange.Stephen Kelly2015-07-221-6/+6
|
* string: add APPEND subcommandDaniel Pfeifer2015-07-071-0/+32
|
* cmStringCommand: Accumulate with cmJoin and range adaptors.Stephen Kelly2015-02-111-31/+11
|
* Replace 'foo.length() > 0' pattern with !foo.empty().Stephen Kelly2015-01-181-1/+1
|
* Replace !foo.size() pattern with foo.empty().Stephen Kelly2015-01-181-1/+1
|
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-7/+7
| | | | All compilers hosting CMake support the std class.
* cmMakefile: store the number of last matches in a CMake varBen Boeckel2014-12-031-38/+6
| | | | | | | | | With PushScope and PopScope, keeping track of another bit of data for each scope isn't easy. Instead, store it as another CMake variable so it gets implicitly tracked along with everything else. This works in a revert of commit 7d674b5f0b28a610333644d417c2e8cb796cc9e4.
* Merge branch 'revert-cached-regex-clear' into ↵Brad King2014-11-261-6/+38
|\ | | | | | | | | | | revert-cached-regex-clear-for-master Resolve conflict in Source/cmMakefile.h by integrating both changes.
| * Revert "ClearMatches: Only clear matches which were actually set" (#15261)Ben Boeckel2014-11-261-6/+38
| | | | | | | | | | | | | | | | | | | | | | This reverts commit v3.1.0-rc1~557^2~2 (ClearMatches: Only clear matches which were actually set, 2014-03-12). The optimization did not track the match count in the same scope as the variables, allowing possible inconsistency. Resolve conflicts in Source/cmIfCommand.cxx, Source/cmMakefile.cxx, and Source/cmMakefile.h by moving the changes to the new location of the code involved.
* | Remove some unneeded c_str calls.Stephen Kelly2014-11-231-1/+1
| |
* | string: Tolerate SUBSTRING length exceeding end indexDomen Vrankar2014-11-131-4/+2
|/ | | | | | string SUBSTRING command now ignores length if it points past end of string and uses end of string instead. String SUBSTRING tests now cover more corner cases.
* StringUuid: Implement new string(UUID) sub-command.Nils Gladitz2014-08-281-0/+116
|
* ClearMatches: Only clear matches which were actually setBen Boeckel2014-04-291-38/+6
| | | | | | | ClearMatches was clearing many variables which were never set in the first place. Instead, store how many matches were made last time and only clear those. It is moved to the cmMakefile class since it is a common utility used by multiple commands.
* cmStringCommand: Add GENEX_STRIP subcommand.Stephen Kelly2014-03-311-0/+25
| | | | Strip out any generator expressions in the input string.
* Remove some c_str() calls.Stephen Kelly2014-03-111-38/+38
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* string: Add CONCAT sub-commandBrad King2013-10-211-0/+25
| | | | | | Add a string(CONCAT) command to simply concatenate input arguments together. This will be useful for combining strings from different quoting syntaxes. Add a RunCMake.string test covering these cases.
* Do not set CMAKE_MATCH_ variables when not neeededBill Hoffman2013-06-141-6/+14
| | | | | | | | | Each call to AddDefinition has overhead for variable watches and such. Avoid extra calls when not needed. This decreases the configure time for ParaView by 10 seconds on my machine. Without the change about 1,000,000 set-to-empty calls were being made. After the change it drops to about 100,000.
* string: Add MAKE_C_IDENTIFIER subcommandStephen Kelly2013-05-211-0/+22
|
* CMake: Fix dashboard warningsDavid Cole2012-12-051-1/+1
| | | | ...in the new file and string TIMESTAMP sub-commands
* CMake: Add TIMESTAMP subcommand to string and file commandsNils Gladitz2012-12-051-0/+54
|
* Remove trailing whitespace from most CMake and C/C++ codeKitware Robot2012-08-131-36/+36
| | | | | | | | | | | | | | | | | Our Git commit hooks disallow modification or addition of lines with trailing whitespace. Wipe out all remnants of trailing whitespace everywhere except third-party code. Run the following shell code: git ls-files -z -- \ bootstrap doxygen.config '*.readme' \ '*.c' '*.cmake' '*.cpp' '*.cxx' \ '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \ '*.mm' '*.pike' '*.py' '*.txt' '*.vim' | egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' | egrep -z -v '^(Modules/CPack\..*\.in)' | xargs -0 sed -i 's/ \+$//'
* Disable file() and string() hash commands during bootstrapBrad King2011-11-161-0/+7
| | | | | We do not compile support for the cryptographic hashes during bootstrap. Disable the APIs that use them.