MCPcopy Index your code
hub / github.com/Kitware/CMake / c_str

Method c_str

Source/cmString.cxx:67–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67char const* String::c_str()
68{
69 char const* c = this->data();
70 if (!c) {
71 return c;
72 }
73
74 // We always point into a null-terminated string so it is safe to
75 // access one past the end. If it is a null byte then we can use
76 // the pointer directly.
77 if (c[this->size()] == '\0') {
78 return c;
79 }
80
81 // Mutate to hold a std::string so we can get a null terminator.
82 this->internally_mutate_to_stable_string();
83 c = this->string_->c_str();
84 return c;
85}
86
87String& String::insert(size_type index, size_type count, char ch)
88{

Callers 15

sendCommandsFunction · 0.80
testXMLSafeFunction · 0.80
testRSTFunction · 0.80
testGeneratedFileStreamFunction · 0.80
testConstructDefaultFunction · 0.80
testFromNullPtrFunction · 0.80
testFromCStrNullFunction · 0.80
testFromCharArrayFunction · 0.80
testFromStaticStringViewFunction · 0.80
testMethod_substr_AtEndFunction · 0.80
test_uv_fs_mkdtempFunction · 0.80

Calls 3

dataMethod · 0.45
sizeMethod · 0.45

Tested by 15

sendCommandsFunction · 0.64
testXMLSafeFunction · 0.64
testRSTFunction · 0.64
testGeneratedFileStreamFunction · 0.64
testConstructDefaultFunction · 0.64
testFromNullPtrFunction · 0.64
testFromCStrNullFunction · 0.64
testFromCharArrayFunction · 0.64
testFromStaticStringViewFunction · 0.64
testMethod_substr_AtEndFunction · 0.64
test_uv_fs_mkdtempFunction · 0.64