
.. _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++/item.hpp`` (:ref:`file_cif++_item.hpp`)

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

- ``cif++/text.hpp`` (:ref:`file_cif++_text.hpp`)

- ``cstddef``

- ``cstdint``

- ``format`` (:ref:`file_cif++_format.hpp`)

- ``functional``

- ``iostream``

- ``optional``

- ``regex``

- ``string``

- ``string_view``

- ``type_traits``

- ``typeinfo``

- ``utility``

- ``vector``



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


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

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

- :ref:`file_cif++_iterator.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_1a1b73d778a0ab90f2ec7a057a6613c268`

- :ref:`exhale_function_namespacecif_1a7da448991e41eef2fa6dbf113827f958`

- :ref:`exhale_function_condition_8hpp_1ae3fb5e492867225091edeba773f91d39`

- :ref:`exhale_function_namespacecif_1af48187a8f25f8cb1acb4f0dd87d4b88b`

- :ref:`exhale_function_namespacecif_1a8e634d8bee993dc3e5bbdd3231f40b5d`

- :ref:`exhale_function_namespacecif_1ab173f10abbd57122dbfd669f30af5509`

- :ref:`exhale_function_namespacecif_1aa697ec53ac311721d137e96508fe6268`

- :ref:`exhale_function_namespacecif_1aa0b8d79a4d7d74949f14d436c3e0f34b`

- :ref:`exhale_function_namespacecif_1a89f948a7392e875f87012ca961060cb3`

- :ref:`exhale_function_namespacecif_1a4c27e27d4cb70a2e13cf2efb05ccd325`

- :ref:`exhale_function_namespacecif_1a8c894208d05a89ca79ed66421d241f0f`

- :ref:`exhale_function_namespacecif_1a561da00d019d125f7356b8717771b6b6`

- :ref:`exhale_function_namespacecif_1a56936f6ca9d4cc7230a4f0e40d0b9cb2`

- :ref:`exhale_function_namespacecif_1ab91dfb39e9ee43942c5d384f161b97f3`

- :ref:`exhale_function_namespacecif_1a4f2dd5c988ef77316bb4fdda57146fd5`

- :ref:`exhale_function_namespacecif_1a2996a300e6f91f05abb11706b3c3cef2`

- :ref:`exhale_function_namespacecif_1ad8a62060b4918e8fcdba571adcde4295`

- :ref:`exhale_function_namespacecif_1ad3654e07e2f3102ac503499fa51d930f`

- :ref:`exhale_function_namespacecif_1acc0e956a0d6382e85c6ecb631e2edd21`

- :ref:`exhale_function_namespacecif_1a867dc9c21324a3e65a931bb4d7160a9e`

- :ref:`exhale_function_namespacecif_1ab80f7d084a897f8654fecdcbe4c598ba`

- :ref:`exhale_function_namespacecif_1a9a46e6bb8184b5c4b2867e50d4bafd46`

- :ref:`exhale_function_namespacecif_1adb70dd5acc76b76db9766ac0a65b1be9`


Variables
---------


- :ref:`exhale_variable_namespacecif_1a9347107ebb4ef72dca122c3285453c4f`

- :ref:`exhale_variable_namespacecif_1a6dacacf91cee6e2c246a2334f0fbd607`

