ns-3
|
Encapsulate OS-specific functions to manipulate file and directory paths. More...
Functions | |
std::string | Dirname (std::string path) |
std::string | FindSelfDirectory (void) |
std::string | Append (std::string left, std::string right) |
std::list< std::string > | Split (std::string path) |
std::string | Join (std::list< std::string >::const_iterator begin, std::list< std::string >::const_iterator end) |
std::list< std::string > | ReadFiles (std::string path) |
std::string | MakeTemporaryDirectoryName (void) |
void | MakeDirectories (std::string path) |
Encapsulate OS-specific functions to manipulate file and directory paths.
The functions provided here are used mostly to implement the ns-3 test framework.
std::string ns3::SystemPath::Append | ( | std::string | left, |
std::string | right | ||
) |
left | a path element |
right | a path element |
std::string ns3::SystemPath::FindSelfDirectory | ( | void | ) |
This function returns the path to the running $PREFIX. Mac OS X: _NSGetExecutablePath() (man 3 dyld) Linux: readlink /proc/self/exe Solaris: getexecname() FreeBSD: sysctl CTL_KERN KERN_PROC KERN_PROC_PATHNAME -1 BSD with procfs: readlink /proc/curproc/file Windows: GetModuleFileName() with hModule = NULL
References NS_ASSERT, and NS_FATAL_ERROR.
std::string ns3::SystemPath::Join | ( | std::list< std::string >::const_iterator | begin, |
std::list< std::string >::const_iterator | end | ||
) |
begin | iterator to first element to join |
end | iterator to last element to join |
Referenced by MakeDirectories().
void ns3::SystemPath::MakeDirectories | ( | std::string | path | ) |
std::string ns3::SystemPath::MakeTemporaryDirectoryName | ( | void | ) |
The returned path identifies a directory which does not exist yet Call ns3::SystemPath::MakeDirectories to create it. Yes, there is a well-known security race in this API but we don't care in ns-3.
std::list< std::string > ns3::SystemPath::ReadFiles | ( | std::string | path | ) |
path | a path which identifies a directory |
References NS_FATAL_ERROR.
std::list< std::string > ns3::SystemPath::Split | ( | std::string | path | ) |
path | a path |
Referenced by MakeDirectories().