MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / infoString

Method infoString

lib/vfvalue.cpp:101–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 std::string Value::infoString() const {
102 switch (valueType) {
103 case ValueType::INT:
104 return MathLib::toString(intvalue);
105 case ValueType::TOK:
106 return tokvalue->str();
107 case ValueType::FLOAT:
108 return MathLib::toString(floatValue);
109 case ValueType::MOVED:
110 return "<Moved>";
111 case ValueType::UNINIT:
112 return "<Uninit>";
113 case ValueType::BUFFER_SIZE:
114 case ValueType::CONTAINER_SIZE:
115 return "size=" + MathLib::toString(intvalue);
116 case ValueType::ITERATOR_START:
117 return "start=" + MathLib::toString(intvalue);
118 case ValueType::ITERATOR_END:
119 return "end=" + MathLib::toString(intvalue);
120 case ValueType::LIFETIME:
121 return "lifetime=" + tokvalue->str();
122 case ValueType::SYMBOLIC:
123 {
124 std::string result = "symbolic=" + tokvalue->expressionString();
125 if (intvalue > 0)
126 result += "+" + MathLib::toString(intvalue);
127 else if (intvalue < 0)
128 result += "-" + MathLib::toString(-intvalue);
129 return result;
130 }
131 }
132 cppcheck::unreachable();
133 }
134
135 const char *Value::toString(MoveKind moveKind) {
136 switch (moveKind) {

Callers 4

valueFlowForwardAssignFunction · 0.80
valueFlowSubFunctionFunction · 0.80
writeValueFunction · 0.80

Calls 4

unreachableFunction · 0.85
toStringFunction · 0.70
strMethod · 0.45
expressionStringMethod · 0.45

Tested by

no test coverage detected