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

Class cmAlphaNum

Source/cmStringAlgorithms.h:209–260  ·  view source on GitHub ↗

Utility class for cmStrCat. */

Source from the content-addressed store, hash-verified

207
208/** Utility class for cmStrCat. */
209class cmAlphaNum
210{
211public:
212 cmAlphaNum(cm::string_view view)
213 : View_(view)
214 {
215 }
216 cmAlphaNum(std::string const& str)
217 : View_(str)
218 {
219 }
220 cmAlphaNum(std::string&& str)
221 : RValueString_(&str)
222 {
223 }
224 cmAlphaNum(char const* str)
225 : View_(str ? cm::string_view(str) : cm::string_view())
226 {
227 }
228 cmAlphaNum(char ch)
229 : View_(this->Digits_, 1)
230 {
231 this->Digits_[0] = ch;
232 }
233 cmAlphaNum(int val);
234 cmAlphaNum(unsigned int val);
235 cmAlphaNum(long int val);
236 cmAlphaNum(unsigned long int val);
237 cmAlphaNum(long long int val);
238 cmAlphaNum(unsigned long long int val);
239 cmAlphaNum(float val);
240 cmAlphaNum(double val);
241 cmAlphaNum(cmValue value)
242 : View_(*value)
243 {
244 }
245
246 cm::string_view View() const
247 {
248 if (this->RValueString_) {
249 return *this->RValueString_;
250 }
251 return this->View_;
252 }
253
254 std::string* RValueString() const { return this->RValueString_; }
255
256private:
257 std::string* RValueString_ = nullptr;
258 cm::string_view View_;
259 char Digits_[32];
260};
261
262/** Concatenate string pieces and numbers into a single string. */
263template <typename A, typename B, typename... AV>

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…