diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-02-16 18:21:44 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-02-20 16:23:46 -0800 |
commit | a99e89a689490aa03e2bbd8153b61e394cd55a6e (patch) | |
tree | db28c00c4d5b44bba918eb4fc52a6683e52fa181 /host/lib/include/uhdlib/utils | |
parent | 2ff296c99760628c4b0042cf6d2b32a0e3986364 (diff) | |
download | uhd-a99e89a689490aa03e2bbd8153b61e394cd55a6e.tar.gz uhd-a99e89a689490aa03e2bbd8153b61e394cd55a6e.tar.bz2 uhd-a99e89a689490aa03e2bbd8153b61e394cd55a6e.zip |
lib: Add path_expandvars() internal API call
Diffstat (limited to 'host/lib/include/uhdlib/utils')
-rw-r--r-- | host/lib/include/uhdlib/utils/paths.hpp | 24 |
1 files changed, 24 insertions, 0 deletions
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 <string> + +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 */ + |