From a99e89a689490aa03e2bbd8153b61e394cd55a6e Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Fri, 16 Feb 2018 18:21:44 -0800 Subject: lib: Add path_expandvars() internal API call --- host/lib/include/uhdlib/utils/paths.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 host/lib/include/uhdlib/utils/paths.hpp (limited to 'host/lib/include') diff --git a/host/lib/include/uhdlib/utils/paths.hpp b/host/lib/include/uhdlib/utils/paths.hpp new file mode 100644 index 000000000..d74973301 --- /dev/null +++ b/host/lib/include/uhdlib/utils/paths.hpp @@ -0,0 +1,24 @@ +// +// Copyright 2018 Ettus Research, a National Instruments Company +// +// SPDX-License-Identifier: GPL-3.0+ +// + +#ifndef INCLUDED_UHDLIB_UTILS_PATHS_HPP +#define INCLUDED_UHDLIB_UTILS_PATHS_HPP + +#include + +namespace uhd { + + /*! Expand environment variables in paths, like Python's + * os.path.expandvars(). + * + * If expansion fails, will simply return the original path. + */ + std::string path_expandvars(const std::string& path); + +} /* namespace uhd */ + +#endif /* INCLUDED_UHDLIB_UTILS_PATHS_HPP */ + -- cgit v1.2.3