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

Method str_if_stable

Source/cmString.cxx:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38std::string const* String::str_if_stable() const
39{
40 if (!this->data()) {
41 // We view no string.
42 // This is stable for the lifetime of our current value.
43 return &empty_string_;
44 }
45
46 if (this->string_ && this->data() == this->string_->data() &&
47 this->size() == this->string_->size()) {
48 // We view an entire string.
49 // This is stable for the lifetime of our current value.
50 return this->string_.get();
51 }
52
53 return nullptr;
54}
55
56std::string const& String::str()
57{

Callers 5

is_stableMethod · 0.95
testStabilityFunction · 0.80
cmString.cxxFile · 0.80
GetMethod · 0.80
ClosureKeysMethod · 0.80

Calls 3

dataMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by 1

testStabilityFunction · 0.64