File condition.hpp

Parent directory (cif++)

Definition (cif++/condition.hpp)

Detailed Description

This file contains code to create conditions: object encapsulating a query you can use to find rows in a Class category

Conditions are created as standard C++ expressions. That means you can use the standard comparison operators to compare field contents with a value and boolean operators to chain everything together.

To create a query that simply compares one field with one value:

:ref:`exhale_class_classcif_1_1condition`c=:ref:`exhale_struct_structcif_1_1key`(“id”)==1;

That will find rows where the ID field contains the number 1. If using Struct key is a bit too much typing, you can also write:

usingnamespacecif::literals;

:ref:`exhale_class_classcif_1_1condition`c2=”id”_key==1;

Now if you want both ID = 1 and ID = 2 in the result:

autoc3=”id”_key==1or”id”_key==2;

There are some special values you can use. To find rows with field that do not have a value:

autoc4=”type”_key==:ref:exhale_variable_namespacecif_1a6dacacf91cee6e2c246a2334f0fbd607;

Of if it should not be NULL:

autoc5=”type”_key!=:ref:exhale_variable_namespacecif_1a6dacacf91cee6e2c246a2334f0fbd607;

There’s even a way to find all records:

autoc6=:ref:exhale_function_namespacecif_1a39ae1da888a5c8a6ee7f1438b78b7734;

And when you want to search for any column containing the value ‘foo’:

autoc7=:ref:`exhale_variable_namespacecif_1a9347107ebb4ef72dca122c3285453c4f`==”foo”;

All these conditions can be chained together again:

autoc8=std::move(c3)andstd::move(c5);

Includes

  • cassert

  • cif++/row.hpp (File row.hpp)

  • functional

  • iostream

  • regex

  • utility

Included By

Namespaces

Classes

Functions

Variables