Skip to main content

Common Fluids Format 2026 R1

ansys::Project::Query Class Reference

Last update: 24.03.2026

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

#include "Query.hpp"

Public Types

enum  Operator {
  OpEqual , OpNotEqual , OpContains , OpListContains ,
  OpHasKey , OpUndefined
}
 

Public Member Functions

 Query ()
 
 Query (std::string pKey, Operator pOp)
 Constructor, simple query with unary operator. More...
 
 Query (std::string pKey, Operator pOp, std::string pVal)
 Constructor, simple query with binary operator. More...
 
Queryoperator+= (const Query &pObj)
 Append a Query object to the current. More...
 
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 Enumeration Documentation

◆ Operator

Enumerator
OpEqual 
OpNotEqual 
OpContains 
OpListContains 
OpHasKey 
OpUndefined 

Constructor & Destructor Documentation

◆ Query() [1/3]

ansys::Project::Query::Query ( )

◆ Query() [2/3]

ansys::Project::Query::Query ( std::string  pKey,
Operator  pOp 
)

Constructor, simple query with unary operator.

◆ Query() [3/3]

ansys::Project::Query::Query ( std::string  pKey,
Operator  pOp,
std::string  pVal 
)

Constructor, simple query with binary operator.

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.

◆ operator+=()

Query & ansys::Project::Query::operator+= ( const Query pObj)

Append a Query object to the current.

Connect with Ansys