pathExists

C++ Function Reference

1 Signature

bool BigDataStatMeth::pathExists(hid_t id, const std::string &path)

2 Description

Checks if a path exists in an HDF5 file.

3 Parameters

  • id (hid_t): HDF5 file or group identifier
  • path (const std::string &): Path to check

4 Returns

bool True if path exists, false otherwise

5 Details

idHDF5 file or group identifier pathPath to check bool True if path exists, false otherwiseH5::FileIExceptionon file operation errors

6 Call Graph

Function dependencies

7 Source Code

File: inst/include/hdf5Utilities/hdf5Utilities.hppLines 40-55

inline bool pathExists(hid_t id, const std::string& path)
    {
        try {
            return H5Lexists( id, path.c_str(), H5P_DEFAULT ) > 0;    
        } catch(H5::FileIException& error) { // catch failure caused by the H5File operations
            Rcpp::Rcerr<<"c++ exception pathExists (File IException)" << std::endl;
            return false;
        } catch(std::exception &ex) {
            Rcpp::Rcerr << "c++ exception pathExists: " << ex.what();
            return false;
        }  catch (...) {
            Rcpp::Rcerr<<"\nC++ exception pathExists (unknown reason)";
            return false;
        }
        
    }

8 Usage Example

#include "BigDataStatMeth.hpp"

// Example usage
auto result = pathExists(...);