User Guide
nmodl::FileLibrary Class Reference

Manage search path. More...

Detailed Description

Manage search path.

Store search path used for handling paths when processing include NMODL directive

Definition at line 30 of file file_library.hpp.

#include <file_library.hpp>

Public Member Functions

 FileLibrary ()=default
 An empty library. More...
 
std::string find_file (const std::filesystem::path &file)
 Search a file. More...
 
Managing inclusion paths.
void append_env_var (const std::string &env_var)
 
current directory
void push_current_directory (const std::filesystem::path &path)
 
void pop_current_directory ()
 

Static Public Member Functions

static FileLibrary default_instance ()
 Initialize the library with the following path: More...
 

Private Member Functions

void push_cwd ()
 push the working directory in the directories stack More...
 

Private Attributes

std::vector< std::filesystem::path > paths_
 inclusion path list More...
 

Constructor & Destructor Documentation

◆ FileLibrary()

nmodl::FileLibrary::FileLibrary ( )
default

An empty library.

Member Function Documentation

◆ append_env_var()

void nmodl::FileLibrary::append_env_var ( const std::string &  env_var)

Definition at line 28 of file file_library.cpp.

◆ default_instance()

FileLibrary nmodl::FileLibrary::default_instance ( )
static

Initialize the library with the following path:

  • current working directory
  • paths in the NMODL_PATH environment variable

Definition at line 21 of file file_library.cpp.

◆ find_file()

std::string nmodl::FileLibrary::find_file ( const std::filesystem::path &  file)

Search a file.

Determine real path of file

Returns
Directory containing file, or "" if not found.

Definition at line 54 of file file_library.cpp.

◆ pop_current_directory()

void nmodl::FileLibrary::pop_current_directory ( )

Definition at line 47 of file file_library.cpp.

◆ push_current_directory()

void nmodl::FileLibrary::push_current_directory ( const std::filesystem::path &  path)

Definition at line 39 of file file_library.cpp.

◆ push_cwd()

void nmodl::FileLibrary::push_cwd ( )
private

push the working directory in the directories stack

Definition at line 43 of file file_library.cpp.

Member Data Documentation

◆ paths_

std::vector<std::filesystem::path> nmodl::FileLibrary::paths_
private

inclusion path list

Definition at line 68 of file file_library.hpp.


The documentation for this class was generated from the following files: