13std::filesystem::path
const nxroot(
"/");
15std::filesystem::path cleanup(std::string
const &s) {
16 std::filesystem::path ret(s);
19 }
else if (s.back() ==
'/') {
21 ret = s.substr(0, s.size() - 1);
23 if (s.starts_with(
"//")) {
27 return ret.lexically_normal();
30std::filesystem::path cleanup(std::filesystem::path
const &p) {
return cleanup(p.string()); }
35 : m_path(cleanup(path)), m_resolved_path(m_path.generic_string()) {}
96 std::vector<std::string> names;
97 for (
auto it =
m_path.begin(); it !=
m_path.end(); it++) {
99 names.push_back(it->generic_string());
This simple class encapsulates some methods for working with paths inside a Nexus file.
std::string operator+(std::string const &s) const
bool operator==(NexusAddress const &p) const
std::vector< std::string > parts() const
std::filesystem::path m_path
standard filesystem path
NexusAddress & operator/=(std::string const &s)
NexusAddress parent_path() const
NexusAddress & operator=(NexusAddress const &nd)=default
NexusAddress operator/(std::string const &s) const
static NexusAddress root()
std::string m_resolved_path
NexusAddress fromRoot() const
NexusAddress stem() const
bool operator!=(NexusAddress const &p) const
std::string const & string() const
MANTID_API_DLL std::ostream & operator<<(std::ostream &, const AlgorithmHistory &)
Prints a text representation.
MatrixWorkspace_sptr MANTID_API_DLL operator+(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Adds two workspaces.
Header for a base Nexus::Exception.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator!=(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)