We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to construct long LDAP expressions and conditionally modify them using concise modern C++.
LDAPFilter filter(LDAPProp("key1") == "value1"); if (someCondition) { filter = LDAPFilter(LDAPPropExpr(filter.ToString()) || LDAPProp("key2") == "value2"); } else { filter = LDAPFilter(LDAPPropExpr(filter.ToString()) || LDAPProp("key3") == "value3"); }
This is not only more code to write for clients, its also wasteful since extra temporary objects need to be created.
LDAPPropExpr::operator=
LDAPProp::operator=
LDAPProp::operator|=
LDAPProp::operator&=
LDAPPropExpr expr(LDAPProp("key1") == "value1"); if (someCondition) { expr = expr || LDAPProp("key2") == "value2"; // or even more conveniently, expr |= LDAPProp("key2") == "value2"; } else { expr = expr || LDAPProp("key3") == "value3"; }
LDAPPropExpr expr(LDAPProp("key1") == "value1"); if (someCondition) { expr |= LDAPProp("key2") == "value2"; } else { expr |= LDAPProp("key3") == "value3"; }
The text was updated successfully, but these errors were encountered:
Support constructing long LDAP expressions using concise C++
7f878f1
Fixes #246 Signed-off-by: The Mathworks Inc <Roy.Lurie@mathworks.com>
Support constructing long LDAP expressions using concise C++ (#247)
a7e4df8
jeffdiclemente
No branches or pull requests
Use Case
I want to construct long LDAP expressions and conditionally modify them using concise modern C++.
Pain Point
LDAP expressions can be conditionally built however it requires more code than is necessary...
This is not only more code to write for clients, its also wasteful since extra temporary objects need to be created.
Solution
LDAPPropExpr::operator=
andLDAPProp::operator=
public.LDAPProp::operator|=
andLDAPProp::operator&=
This allows the following to be written...
And even more concisely...
The text was updated successfully, but these errors were encountered: