MCPcopy Create free account
hub / github.com/CppMicroServices/CppMicroServices / getAttributeValue

Method getAttributeValue

framework/src/util/LDAPExpr.cpp:1145–1188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1143 }
1144
1145 std::string
1146 LDAPExpr::ParseState::getAttributeValue()
1147 {
1148 int num_parens = 0;
1149 std::string sb;
1150 bool exit = false;
1151 while (!exit)
1152 {
1153 Byte c = peek();
1154 switch (c)
1155 {
1156 case '(':
1157 ++num_parens;
1158 sb.append(1, c);
1159 break;
1160 case ')':
1161 if (num_parens > 0)
1162 {
1163 --num_parens;
1164 sb.append(1, c);
1165 }
1166 else
1167 {
1168 exit = true;
1169 }
1170 break;
1171 case '*':
1172 sb.append(1, LDAPExprConstants::WILDCARD());
1173 break;
1174 case '\\':
1175 sb.append(1, m_str.at(++m_pos));
1176 break;
1177 default:
1178 sb.append(1, c);
1179 break;
1180 }
1181
1182 if (!exit)
1183 {
1184 m_pos++;
1185 }
1186 }
1187 return sb;
1188 }
1189
1190 void
1191 LDAPExpr::ParseState::error(std::string const& m) const

Callers 1

ParseSimpleMethod · 0.80

Calls 2

WILDCARDFunction · 0.85
atMethod · 0.80

Tested by

no test coverage detected