| 132 | } |
| 133 | |
| 134 | CMakeString 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 | |
| 150 | CMakeString& CMakeString::Strip(StripItems stripItems) |
| 151 | { |
no test coverage detected