Permalink
Browse files

uhd: added uhd::get_pkg_data_path

  • Loading branch information...
1 parent b216f71 commit 98074d0c29e818f3aa08edf451f4e7351116deae @guruofquality guruofquality committed Jun 6, 2012
Showing with 9 additions and 5 deletions.
  1. +4 −1 host/include/uhd/utils/paths.hpp
  2. +5 −4 host/lib/utils/paths.cpp
@@ -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 */
View
@@ -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;
}

0 comments on commit 98074d0

Please sign in to comment.