> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ansys::Project::Query Class Reference

Set of conditions used in search within the [Project](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_project). See [Iterator::find()](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_iterator.md#a117905095e2e70e0a2f9dbe051882bec)

`#include "Query.hpp"`

## Public Types

| Type | Name |
| - | - |
| enum | [Operator](#a573f60ab433e79d792adc3a2c43d2c36) \{  [OpEqual](#a573f60ab433e79d792adc3a2c43d2c36ae62e264ca6b0f30b8d49044190639449) , [OpNotEqual](#a573f60ab433e79d792adc3a2c43d2c36a6e8f7d5bad3a36fa6212252c5da5cd33) , [OpContains](#a573f60ab433e79d792adc3a2c43d2c36ac49a884da01c7007be9fc1b1e93b1a52) , [OpListContains](#a573f60ab433e79d792adc3a2c43d2c36a28e5ef4722c4d187064f65e84ff099f9) ,  [OpHasKey](#a573f60ab433e79d792adc3a2c43d2c36ac87d95f911ec121fa546be5acf89b5cd) , [OpUndefined](#a573f60ab433e79d792adc3a2c43d2c36ad392018e2a341cc8d174f4001eff1600)  } |

## Public Member Functions

| Type | Name |
| - | - |
| | [Query](#a693abfd1bbc617dbd463a529182c696a) () |
| | [Query](#accc4b3a49109a0d992c9bea5f67de8b2) (std::string pKey, [Operator](#a573f60ab433e79d792adc3a2c43d2c36) pOp) Constructor, simple query with unary operator. |
| | [Query](#aa11759b898e8ce9ad56ea93b5e7f3fe9) (std::string pKey, [Operator](#a573f60ab433e79d792adc3a2c43d2c36) pOp, std::string pVal) Constructor, simple query with binary operator. |
| [Query](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_query.md) & | [operator+=](#a94479fcb90a6a98679740625ceeef0a9) (const [Query](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_query.md) \&pObj) Append a [Query](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_query.md) object to the current. |
| bool | [evaluate](#a2954de4bce6cb1e254c5fc05071d05aa) (const [Iterator](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_iterator.md) \&pIter) Evaluates the query for the specified iterator. |
| bool | [evaluate](#adb860209358e8dffe5703593f991637f) (const [Metadata](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_metadata.md) \&pMeta) Evaluates the query for the specified metadata object Only variable names prefixed by [Metadata](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_metadata.md):: will be evaluated. |

## Detailed Description

Set of conditions used in search within the [Project](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_project). See [Iterator::find()](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_iterator.md#a117905095e2e70e0a2f9dbe051882bec)

[Query](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_query.md) variables:

* name : The project item name
* type : The project item type (File, Folder, Link, ...)
* subclass : The item subclass
* [Metadata](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_metadata.md)::\* : The metadata key named \*

[Query](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_query.md) operators:

* OpEqual , OpNotEqual : Equality operator
* OpContains : Check if the string contains the specified value
* OpListContains : Check if the data is a CSV vector and contains the value
* OpHasKey : Check if the key is known ([Metadata](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_metadata.md)::\*)

A query will succeed if all key-operator-\[value] tuples are true.

## Member Enumeration Documentation

### Operator

```cpp theme={null}
enum ansys::Project::Query::Operator
```

| Enumerator | |
| - | - |
| OpEqual | |
| OpNotEqual | |
| OpContains | |
| OpListContains | |
| OpHasKey | |
| OpUndefined | |

## Constructor & Destructor Documentation

### Query() \[1/3]

```cpp theme={null}
ansys::Project::Query::Query()
```

### Query() \[2/3]

```cpp theme={null}
ansys::Project::Query::Query(
    std::string pKey,
    Operator pOp
)
```

Constructor, simple query with unary operator.

### Query() \[3/3]

```cpp theme={null}
ansys::Project::Query::Query(
    std::string pKey,
    Operator pOp,
    std::string pVal
)
```

Constructor, simple query with binary operator.

## Member Function Documentation

### evaluate() \[1/2]

```cpp theme={null}
bool ansys::Project::Query::evaluate(const Iterator & pIter)
```

Evaluates the query for the specified iterator.

**Returns**

true if the [Query](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_query.md) matches the iterator content.

### evaluate() \[2/2]

```cpp theme={null}
bool ansys::Project::Query::evaluate(const Metadata & pMeta)
```

Evaluates the query for the specified metadata object Only variable names prefixed by [Metadata](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_metadata.md):: will be evaluated.

**Returns**

true if the [Metadata](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_metadata.md) matches the iterator content.

### operator+=()

```cpp theme={null}
Query & ansys::Project::Query::operator+=(const Query & pObj)
```

Append a [Query](https://developer.synopsys.com/docs/cff/common-fluids-format-sdk-guide/2025-r2/classansys_1_1_project_1_1_query.md) object to the current.
