ns-3 Direct Code Execution
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ns3::SearchPath Class Reference

Class representing a search PATH. More...

#include <exec-utils.h>

+ Collaboration diagram for ns3::SearchPath:

Public Member Functions

 SearchPath (std::string basepath, std::string path, bool virt)
std::string SeekFile (std::string file, std::string cwd, void *userData, bool(*checker)(std::string, void *))

Private Attributes

std::string m_basePath
std::vector< std::string > m_paths
bool m_virtual

Detailed Description

Class representing a search PATH.

Definition at line 92 of file exec-utils.h.

Constructor & Destructor Documentation

ns3::SearchPath::SearchPath ( std::string  basepath,
std::string  path,
bool  virt 
)
Parameters
basepathindicate the Virtual root if needed.
patha search path like the well know PATH environment variable.
virtif true the basepath indicate a virtual root and then it is forbidden to find file not under this basepath.

Definition at line 189 of file exec-utils.cc.

References ns3::CanonizePath(), m_basePath, m_paths, and ns3::Split().

+ Here is the call graph for this function:

Member Function Documentation

std::string ns3::SearchPath::SeekFile ( std::string  file,
std::string  cwd,
void *  userData,
bool(*)(std::string, void *)  checker 
)
Parameters
filefile seeked, can be a simple name (myfile) or a relative path (./myfile) or an absolute path (/tmp/myfile)
cwdcurrent working directory of the virtual process seeking a file, it is used only if the upper parameter file is a relative path.
userDataan opaque data passed to the callback just below
checkera required callback called to check and validate or not the potential files found by this method.

Definition at line 208 of file exec-utils.cc.

References ns3::CanonizePath(), m_basePath, m_paths, and m_virtual.

Referenced by ns3::SearchAbsoluteFile(), ns3::SearchRelativeFile(), and ns3::SearchSimpleFile().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

std::string ns3::SearchPath::m_basePath
private

Definition at line 115 of file exec-utils.h.

Referenced by SearchPath(), and SeekFile().

std::vector<std::string> ns3::SearchPath::m_paths
private

Definition at line 116 of file exec-utils.h.

Referenced by SearchPath(), and SeekFile().

bool ns3::SearchPath::m_virtual
private

Definition at line 114 of file exec-utils.h.

Referenced by SeekFile().


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