F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FilePathUtils.cpp File Reference
#include <Fw/Types/Assert.hpp>
#include <Fw/Types/StringUtils.hpp>
#include <Os/FilePathUtils.hpp>
#include <Os/FileSystem.hpp>
#include <cstring>

Go to the source code of this file.

Namespaces

 Os
 
 Os::FilePathUtils
 Utility for canonicalizing file paths and checking directory containment.
 

Functions

static bool Os::FilePathUtils::isValidCString (FwSizeType measuredLen, FwSizeType bufferLen)
 
static Status Os::FilePathUtils::buildAbsolutePath (const char *path, const char *baseDir, char *resolvedOut, FwSizeType resolvedSize)
 
static Status Os::FilePathUtils::resolveInPlace (char *resolvedOut)
 
Status Os::FilePathUtils::resolvePath (const char *path, const char *baseDir, char *resolvedOut, FwSizeType resolvedSize)
 Resolve a path by collapsing . and .. segments. More...
 
Status Os::FilePathUtils::resolvePath (const Fw::ConstStringBase &path, const Fw::ConstStringBase &baseDir, Fw::StringBase &resolvedOut)
 Resolve a path (Fw::StringBase overload) More...
 
Status Os::FilePathUtils::resolveFromCwd (const char *path, char *resolvedOut, FwSizeType resolvedSize)
 Resolve a path using CWD as the base for relative paths. More...
 
Status Os::FilePathUtils::checkContainment (const char *resolvedPath, const char *allowedDirectory)
 Check whether an already-resolved path is within an allowed directory. More...