MCPcopy Create free account
hub / github.com/apache/trafficserver / VerifySimpleKey

Method VerifySimpleKey

lib/yamlcpp/src/simplekey.cpp:100–126  ·  view source on GitHub ↗

VerifySimpleKey . Determines whether the latest simple key to be added is valid, and if so, makes it valid.

Source from the content-addressed store, hash-verified

98// . Determines whether the latest simple key to be added is valid,
99// and if so, makes it valid.
100bool Scanner::VerifySimpleKey() {
101 if (m_simpleKeys.empty())
102 return false;
103
104 // grab top key
105 SimpleKey key = m_simpleKeys.top();
106
107 // only validate if we're in the correct flow level
108 if (key.flowLevel != GetFlowLevel())
109 return false;
110
111 m_simpleKeys.pop();
112
113 bool isValid = true;
114
115 // needs to be less than 1024 characters and inline
116 if (INPUT.line() != key.mark.line || INPUT.pos() - key.mark.pos > 1024)
117 isValid = false;
118
119 // invalidate key
120 if (isValid)
121 key.Validate();
122 else
123 key.Invalidate();
124
125 return isValid;
126}
127
128void Scanner::PopAllSimpleKeys() {
129 while (!m_simpleKeys.empty())

Callers

nothing calls this directly

Calls 7

posMethod · 0.80
InvalidateMethod · 0.80
emptyMethod · 0.45
topMethod · 0.45
popMethod · 0.45
lineMethod · 0.45
ValidateMethod · 0.45

Tested by

no test coverage detected