From beabf3d302a98a0a1e28ae8cc4d338f0bd13db6e Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Mon, 3 Nov 2014 17:05:26 -0800 Subject: uhd: replaced the `images_error` with a generic utility error - Deleted images.*, moved functionality to paths.* - Applies for all devices that check FPGA or FW compat numbers - Adds generic utility search tool --- host/include/uhd/utils/CMakeLists.txt | 1 - host/include/uhd/utils/images.hpp | 53 ----------------------------------- host/include/uhd/utils/paths.hpp | 25 +++++++++++++++++ 3 files changed, 25 insertions(+), 54 deletions(-) delete mode 100644 host/include/uhd/utils/images.hpp (limited to 'host/include') diff --git a/host/include/uhd/utils/CMakeLists.txt b/host/include/uhd/utils/CMakeLists.txt index c308c9cde..05f6892d2 100644 --- a/host/include/uhd/utils/CMakeLists.txt +++ b/host/include/uhd/utils/CMakeLists.txt @@ -25,7 +25,6 @@ UHD_INSTALL(FILES cast.hpp csv.hpp gain_group.hpp - images.hpp log.hpp math.hpp msg.hpp diff --git a/host/include/uhd/utils/images.hpp b/host/include/uhd/utils/images.hpp deleted file mode 100644 index a0934fb08..000000000 --- a/host/include/uhd/utils/images.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright 2010,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 -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// - -#ifndef INCLUDED_UHD_UTILS_IMAGES_HPP -#define INCLUDED_UHD_UTILS_IMAGES_HPP - -#include -#include - -namespace uhd{ - - /*! - * Search for an image in the system image paths: - * Search compiled-in paths and environment variable paths - * for a specific image file with the provided file name. - * \param image_name the name of the file - * \return the full system path to the file - * \throw exception if the image was not found - */ - UHD_API std::string find_image_path(const std::string &image_name); - - /*! - * Search for the location of the UHD Images Downloader script. - * \return the full system path to uhd_images_downloader.py - */ - - UHD_API std::string find_images_downloader(void); - - /*! - * Return the error string for recommending using the UHD Images Downloader. - * String depends on OS. - * \return the message suggesting the use of uhd_images_downloader.py - */ - - UHD_API std::string print_images_error(void); - -} //namespace uhd - -#endif /* INCLUDED_UHD_UTILS_IMAGES_HPP */ diff --git a/host/include/uhd/utils/paths.hpp b/host/include/uhd/utils/paths.hpp index e0f455e92..c1f32ba61 100644 --- a/host/include/uhd/utils/paths.hpp +++ b/host/include/uhd/utils/paths.hpp @@ -32,6 +32,31 @@ namespace uhd{ //! Get a string representing the system's pkg directory UHD_API std::string get_pkg_path(void); + /*! + * Search for an image in the system image paths: + * Search compiled-in paths and environment variable paths + * for a specific image file with the provided file name. + * \param image_name the name of the file + * \return the full system path to the file + * \throw exception if the image was not found + */ + UHD_API std::string find_image_path(const std::string &image_name); + + /*! + * Search for the location of a particular UHD utility. + * The utility must be installed in the `uhd/utils` directory. + * \param the name of the utility to search for + * \return the full system path to @param + */ + UHD_API std::string find_utility(std::string name); + + /*! + * Return an error string recommending the user run the utility. + * The error string will include the full path to the utility to run. + * \return the message suggesting the use of the named utility. + */ + UHD_API std::string print_utility_error(std::string name); + } //namespace uhd #endif /* INCLUDED_UHD_UTILS_PATHS_HPP */ -- cgit v1.2.3