47 #ifndef _MIRA_PATHFINDERCONSTEXPR_H_ 48 #define _MIRA_PATHFINDERCONSTEXPR_H_ 50 #include <boost/preprocessor/stringize.hpp> 68 const std::string_view& miraPaths)
71 auto pathsDelim =
':';
73 const auto& npos = std::string_view::npos;
76 size_t to = miraPaths.find(pathsDelim, pos);
78 auto miraPath = miraPaths.substr(pos, to == npos ? npos : to-pos);
86 while (miraPath.back() == pathDelim)
87 miraPath = miraPath.substr(0, miraPath.size()-1);
89 if (path.compare(miraPath) == 0)
91 else if (path.size() > miraPath.size()) {
92 if ((path.compare(0, miraPath.size(), miraPath) == 0) && (path[miraPath.size()] == pathDelim))
155 const std::string_view& miraPaths)
157 auto pathDelim =
'/';
160 if (miraPath.empty())
163 auto pathInMiraPath = path.substr(miraPath.size());
165 while (!pathInMiraPath.empty() && (pathInMiraPath.front() == pathDelim))
166 pathInMiraPath.remove_prefix(1);
168 return pathInMiraPath;
179 constexpr
const char*
chopMIRAPath(
const char* path,
const char* miraPaths)
181 return chopMIRAPath(std::string_view(path), std::string_view(miraPaths)).data();
200 return chopMIRAPath(path, BOOST_PP_STRINGIZE(MIRA_PATHS));
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
MIRA_BASE_EXPORT Path findContainingMIRAPath(const Path &path)
Returns the MIRA path that contains the given path.
MIRA_BASE_EXPORT Path chopMIRAPath(const Path &path)
Removes the root part of the given path that belongs to one of MIRA paths.