summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-06-05 17:43:39 -0700
committerJosh Blum <josh@joshknows.com>2012-06-05 17:59:44 -0700
commit98074d0c29e818f3aa08edf451f4e7351116deae (patch)
tree8f5274de68f258476f47446d060fa0d8312a73b4 /host
parentb216f715bc69a624e985021655ee1922b04adb3d (diff)
downloaduhd-98074d0c29e818f3aa08edf451f4e7351116deae.tar.gz
uhd-98074d0c29e818f3aa08edf451f4e7351116deae.tar.bz2
uhd-98074d0c29e818f3aa08edf451f4e7351116deae.zip
uhd: added uhd::get_pkg_data_path
Diffstat (limited to 'host')
-rw-r--r--host/include/uhd/utils/paths.hpp5
-rw-r--r--host/lib/utils/paths.cpp9
2 files changed, 9 insertions, 5 deletions
diff --git a/host/include/uhd/utils/paths.hpp b/host/include/uhd/utils/paths.hpp
index 2261f1b77..f5a40b2c9 100644
--- a/host/include/uhd/utils/paths.hpp
+++ b/host/include/uhd/utils/paths.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2011 Ettus Research LLC
+// Copyright 2011-2012 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -29,6 +29,9 @@ namespace uhd{
//! Get a string representing the system's appdata directory
UHD_API std::string get_app_path(void);
+ //! Get a string representing the system's pkg data directory
+ UHD_API std::string get_pkg_data_path(void);
+
} //namespace uhd
#endif /* INCLUDED_UHD_UTILS_PATHS_HPP */
diff --git a/host/lib/utils/paths.cpp b/host/lib/utils/paths.cpp
index 43094521a..26fa6d1c7 100644
--- a/host/lib/utils/paths.cpp
+++ b/host/lib/utils/paths.cpp
@@ -71,19 +71,20 @@ static std::vector<fs::path> get_env_paths(const std::string &var_name){
/***********************************************************************
* Get a list of special purpose paths
**********************************************************************/
-static fs::path get_uhd_pkg_data_path(void){
- return fs::path(get_env_var("UHD_PKG_DATA_PATH", UHD_PKG_DATA_PATH));
+std::string uhd::get_pkg_data_path(void)
+{
+ return get_env_var("UHD_PKG_DATA_PATH", UHD_PKG_DATA_PATH);
}
std::vector<fs::path> get_image_paths(void){
std::vector<fs::path> paths = get_env_paths("UHD_IMAGE_PATH");
- paths.push_back(get_uhd_pkg_data_path() / "images");
+ paths.push_back(fs::path(uhd::get_pkg_data_path()) / "images");
return paths;
}
std::vector<fs::path> get_module_paths(void){
std::vector<fs::path> paths = get_env_paths("UHD_MODULE_PATH");
- paths.push_back(get_uhd_pkg_data_path() / "modules");
+ paths.push_back(fs::path(uhd::get_pkg_data_path()) / "modules");
return paths;
}