Skip to main content

Common Fluids Format 2024 R2

ansys::Project::Query Class Reference

Last update: 16.07.2025

Set of conditions used in search within the Project. See Iterator::find() More...

#include "Query.hpp"

Public Member Functions

 Query (std::string pKey, Operator pOp)
 Constructor, simple query with unary operator.
 
 Query (std::string pKey, Operator pOp, std::string pVal)
 Constructor, simple query with binary operator.
 
Queryoperator+= (const Query &pObj)
 Append a Query object to the current.
 
bool evaluate (const Iterator &pIter)
 Evaluates the query for the specified iterator. More...
 
bool evaluate (const Metadata &pMeta)
 Evaluates the query for the specified metadata object Only variable names prefixed by Metadata:: will be evaluated. More...
 

Detailed Description

Set of conditions used in search within the Project. See Iterator::find()

Query variables:

  • name : The project item name
  • type : The project item type (File, Folder, Link, ...)
  • subclass : The item subclass
  • Metadata::* : The metadata key named *

Query 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::*)

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

Member Function Documentation

◆ evaluate() [1/2]

bool ansys::Project::Query::evaluate ( const Iterator pIter)

Evaluates the query for the specified iterator.

Returns
true if the Query matches the iterator content.

◆ evaluate() [2/2]

bool ansys::Project::Query::evaluate ( const Metadata pMeta)

Evaluates the query for the specified metadata object Only variable names prefixed by Metadata:: will be evaluated.

Returns
true if the Metadata matches the iterator content.

Connect with Ansys