OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
PathResolver.cpp File Reference

PathResolver implementation — see PathResolver.hpp. More...

#include "PathResolver.hpp"
#include <algorithm>
#include <cctype>
#include <filesystem>
#include <string>
#include <string_view>
Include dependency graph for PathResolver.cpp:

Namespaces

namespace  openswmm
 
namespace  openswmm::io
 

Functions

bool openswmm::io::isAbsolutePath (const std::string &path) noexcept
 True iff path is absolute on the current platform.
 
std::string openswmm::io::normaliseSeparators (const std::string &path)
 Convert all backslashes to forward-slashes; collapse ./ and duplicate slashes; drop trailing slash (except for filesystem roots like / or C:/).
 
std::string openswmm::io::parentDir (const std::string &file_path)
 Parent directory portion of file_path, canonicalised for use as an anchor to makeRelative / resolveRelative.
 
std::string openswmm::io::resolveRelative (const std::string &stored_token, const std::string &anchor_dir)
 Resolve a possibly-relative token against an anchor directory.
 
RelativeResult openswmm::io::makeRelative (const std::string &target_absolute, const std::string &anchor_dir, int max_up_levels=16)
 Compute target_absolute expressed relative to anchor_dir.
 

Detailed Description

PathResolver implementation — see PathResolver.hpp.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License