.. _program_listing_file_src_navtk_utils_data.hpp: Program Listing for File data.hpp ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/navtk/utils/data.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include #include #include #define NAVTK_DATA_DIR_ENV_VAR "NAVTK_DATA_DIR" #define NAVTK_DATA_FILE_ENV_VAR_PREFIX "NAVTK_" #define NAVTK_DATA_FILE_ENV_VAR_SUFFIX "_PATH" #define NAVTK_OS_DATA_DIR_SUBFOLDER_NAME "navtk" namespace navtk { namespace utils { // This is exposed in the API rather than forward-declared because it's used by the Python bindings // to reimplement navtk::utils::open_data_file in terms of Python file objects rather than // ifstreams. namespace detail { void visit_possible_file_paths(ErrorMode error_mode, const std::string& label, const std::string& basename, std::function try_path); } // namespace detail // The odd quoting syntax in this docstring ``%%APPDATA% `` is a workaround for a bug in Exhale // that swallows the leading % in Windows environment variable names otherwise. std::shared_ptr open_data_file(ErrorMode error_mode, const std::string& label, const std::string& basename, std::ios_base::openmode mode = std::ios_base::in); #ifndef NEED_DOXYGEN_EXHALE_WORKAROUND std::shared_ptr open_data_file(const std::string& label, const std::string& basename, std::ios_base::openmode mode = std::ios_base::in); #endif } // namespace utils } // namespace navtk