Files
Jungfraujoch/common/CheckPath.h
T
leonarski_f 7f3d28b11b
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 12m28s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 15m25s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 16m14s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 17m39s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 18m10s
Build Packages / build:rpm (rocky8) (push) Successful in 18m11s
Build Packages / build:rpm (rocky9) (push) Successful in 19m14s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 19m21s
Build Packages / Generate python client (push) Successful in 2m2s
Build Packages / Build documentation (push) Successful in 2m24s
Build Packages / Create release (push) Has been skipped
Build Packages / build:rpm (ubuntu2204) (push) Successful in 9m34s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 10m52s
Build Packages / XDS test (durin plugin) (push) Successful in 9m43s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m6s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 9m46s
Build Packages / DIALS test (push) Successful in 13m33s
Build Packages / Unit tests (push) Has been cancelled
CheckPath: Fix to handle current logic
2026-04-15 08:59:49 +02:00

23 lines
871 B
C++

// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#ifndef JFJOCH_CHECKPATH_H
#define JFJOCH_CHECKPATH_H
#include <string>
#include "JFJochException.h"
inline void CheckPath(const std::string &s) {
if (!s.empty() && s.front() == '/')
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Path cannot start with slash");
if (s.size() >= 3 && s.substr(0,3) == "../")
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Path cannot start with ../");
if (s.find("/../") != std::string::npos)
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Path cannot contain /../");
}
#endif //JFJOCH_CHECKPATH_H