MCPcopy Create free account
hub / github.com/Kitware/CMake / Substring

Method Substring

Source/cmCMakeString.cxx:134–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134CMakeString CMakeString::Substring(long begin, long count) const
135{
136 if (begin < 0 || static_cast<size_type>(begin) > this->String_.size()) {
137 throw std::out_of_range(cmStrCat(
138 "begin index: ", begin, " is out of range 0 - ", this->String_.size()));
139 }
140 if (count < -1) {
141 throw std::out_of_range(
142 cmStrCat("end index: ", count, " should be -1 or greater"));
143 }
144
145 return this->String_.substr(static_cast<size_type>(begin),
146 count == -1 ? npos
147 : static_cast<size_type>(count));
148}
149
150CMakeString& CMakeString::Strip(StripItems stripItems)
151{

Callers 2

HandleSubstringCommandFunction · 0.80
EvaluateMethod · 0.80

Calls 3

cmStrCatFunction · 0.70
sizeMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected