tfel
Loading...
Searching...
No Matches
mfront::SearchPathsHandler Struct Reference

#include </home/runner/work/tfel/tfel/mfront/include/MFront/SearchPathsHandler.hxx>

Classes

struct  MadnexPath
 structure describing a path in a madnex file More...

Public Types

using Path = std::variant<std::string, MadnexPath>
 a simple alias

Public Member Functions

 SearchPathsHandler (const SearchPathsHandler &)=delete
 SearchPathsHandler (SearchPathsHandler &&)=delete
SearchPathsHandler & operator= (const SearchPathsHandler &)=delete
SearchPathsHandler & operator= (SearchPathsHandler &&)=delete

Static Public Member Functions

static std::string search (const std::string &)
static void addMadnexSearchPath (const std::string &)
 append a madnex search path
static void addSearchPaths (const std::string &)
 Add new search paths.
static void addSearchPathsFromImplementationPaths (const std::vector< std::string > &)
 add search paths for implementations paths.
static std::vector< std::string > getSearchPaths ()
static std::vector< Path > getRegistredPaths ()
static void resetPaths (const std::vector< Path > &)
 reset the paths

Detailed Description

structure in charge of:

  • storing search paths
  • searching imported mfront file

Member Function Documentation

◆ addMadnexSearchPath()

void mfront::SearchPathsHandler::addMadnexSearchPath ( const std::string & )
static

append a madnex search path

The path has one of the form:

  • <file_path>
  • <file_path>:<mkt>
  • <file_path>:<mkt>:<material_id>

<mkt> can have one of the values material_property (or MaterialProperty), behaviour (or Behaviour) or model (or Model). If <mkt> is empty or not specified, all types of material knowledge are selected.

<material_id> can be a regular expression. <material_id> can also have the special value <none>.

If the material identifier is empty or not specified, only the material knowledge associated with no material is selected, as with <none>. The regular expression .* selects all materials, including the empty one.

Parameters
[in]ppath

◆ addSearchPaths()

void mfront::SearchPathsHandler::addSearchPaths ( const std::string & )
static

Add new search paths.

Multiple paths are separated by colons under unices systems and by semicolons under Windows systems.

Parameters
[in]p: new search paths

◆ addSearchPathsFromImplementationPaths()

void mfront::SearchPathsHandler::addSearchPathsFromImplementationPaths ( const std::vector< std::string > & )
static

add search paths for implementations paths.

Parameters
[in]paths: implementation paths

◆ getRegistredPaths()

std::vector< Path > mfront::SearchPathsHandler::getRegistredPaths ( )
staticnodiscard
Returns
the registred paths

◆ getSearchPaths()

std::vector< std::string > mfront::SearchPathsHandler::getSearchPaths ( )
staticnodiscard
Returns
the list of the search paths associated with directories

◆ resetPaths()

void mfront::SearchPathsHandler::resetPaths ( const std::vector< Path > & )
static

reset the paths

Parameters
[in]npathsnew paths

◆ search()

std::string mfront::SearchPathsHandler::search ( const std::string & )
staticnodiscard

search a file in the specified paths. The file is searched using the following conventions :

  • search in the current directory.
  • search in the search paths from the most recently declared search path to the older ones.

Search paths declared through the MFRONT_INCLUDE_PATH are stored at the end of the list.

Parameters
[in]f: file name
Returns
the full path of the file

The documentation for this struct was generated from the following file: