
.. _file_cif++_condition.hpp:

File condition.hpp
==================

|exhale_lsh| :ref:`Parent directory <dir_cif++>` (``cif++``)

.. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS

Definition (``cif++/condition.hpp``)
------------------------------------


.. toctree::
   :maxdepth: 1

   program_listing_file_cif++_condition.hpp.rst



Detailed Description
--------------------

This file contains code to create conditions: object encapsulating a query you can use to find rows in a :ref:`exhale_class_classcif_1_1category`

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

To create a query that simply compares one item 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 item contains the number 1. If using :ref:`exhale_struct_structcif_1_1key` 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 item 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 item 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++/format.hpp`` (:ref:`file_cif++_format.hpp`)

- ``cif++/row.hpp`` (:ref:`file_cif++_row.hpp`)

- ``concepts``

- ``functional``

- ``iostream``

- ``regex``

- ``utility``



Included By
-----------


- :ref:`file_cif++_category.hpp`




Namespaces
----------


- :ref:`namespace_cif`

- :ref:`namespace_cif__detail`

- :ref:`namespace_cif__literals`


Classes
-------


- :ref:`exhale_struct_structcif_1_1empty__type`

- :ref:`exhale_struct_structcif_1_1key`

- :ref:`exhale_class_classcif_1_1condition`


Functions
---------


- :ref:`exhale_function_namespacecif_1a39ae1da888a5c8a6ee7f1438b78b7734`

- :ref:`exhale_function_namespacecif_1adecaf77ddb0b38da346fecf70b5df2e0`

- :ref:`exhale_function_namespacecif_1a1425b605f99bf04eeb638f55c0d91566`

- :ref:`exhale_function_namespacecif_1aa0722da1df2e70c4c68cb1e512978cae`

- :ref:`exhale_function_namespacecif_1a7da448991e41eef2fa6dbf113827f958`

- :ref:`exhale_function_condition_8hpp_1ae3fb5e492867225091edeba773f91d39`

- :ref:`exhale_function_namespacecif_1a7b0b6dec945a1157aa9d455fd35494df`

- :ref:`exhale_function_namespacecif_1ab5bf28cddf2fe7bbfe60778c60f9082e`

- :ref:`exhale_function_namespacecif_1a28d3d6db55465d265cb5b6a7a7d93a6b`

- :ref:`exhale_function_namespacecif_1aa697ec53ac311721d137e96508fe6268`

- :ref:`exhale_function_namespacecif_1a75df878566a514b909141bad937280f4`

- :ref:`exhale_function_namespacecif_1a5c256bdffd9190e69c087e64b69d786d`

- :ref:`exhale_function_namespacecif_1ab173f10abbd57122dbfd669f30af5509`

- :ref:`exhale_function_namespacecif_1a4c27e27d4cb70a2e13cf2efb05ccd325`

- :ref:`exhale_function_namespacecif_1a89f948a7392e875f87012ca961060cb3`

- :ref:`exhale_function_namespacecif_1a561da00d019d125f7356b8717771b6b6`

- :ref:`exhale_function_namespacecif_1a8c894208d05a89ca79ed66421d241f0f`

- :ref:`exhale_function_namespacecif_1a3f5264d06e1b2326aadfae8b3b114414`

- :ref:`exhale_function_namespacecif_1ad8a62060b4918e8fcdba571adcde4295`

- :ref:`exhale_function_namespacecif_1a490147eab255051c58bc3d7d16471e17`

- :ref:`exhale_function_namespacecif_1ad3654e07e2f3102ac503499fa51d930f`

- :ref:`exhale_function_namespacecif_1a4da118af7b65801fd61c48356e67e4a1`

- :ref:`exhale_function_namespacecif_1ab91dfb39e9ee43942c5d384f161b97f3`

- :ref:`exhale_function_namespacecif_1a4f2dd5c988ef77316bb4fdda57146fd5`

- :ref:`exhale_function_namespacecif_1a2996a300e6f91f05abb11706b3c3cef2`

- :ref:`exhale_function_namespacecif_1a867dc9c21324a3e65a931bb4d7160a9e`

- :ref:`exhale_function_namespacecif_1acc0e956a0d6382e85c6ecb631e2edd21`

- :ref:`exhale_function_namespacecif_1a9a46e6bb8184b5c4b2867e50d4bafd46`

- :ref:`exhale_function_namespacecif_1ab80f7d084a897f8654fecdcbe4c598ba`


Variables
---------


- :ref:`exhale_variable_namespacecif_1a9347107ebb4ef72dca122c3285453c4f`

- :ref:`exhale_variable_namespacecif_1a6dacacf91cee6e2c246a2334f0fbd607`

