141 throw std::runtime_error(
"Invalid ImageFlags for const buffer: the DONT_COPY flag together with the READWRITE flag");
150 return from_buffer(data, mem_type_holder.
get(data), mem_space, flags);
160 throw std::runtime_error(
"Invalid ImageFlags in from_buffer: the DONT_COPY flag without the DONT_RELEASE flag");
161 size_t databytesize = signed2unsigned<size_t>(mem_space.
size()) * mem_type.
size();
166 fid = H5LTopen_file_image(
dataspace::ptr(data), databytesize, flags);
169 std::stringstream ss;
170 ss <<
"Failure opening file image";
177 std::stringstream ss;
178 ss<<
"Failure to open non-integer buffer";
Wrapper for hid_t object identifiers.
Definition object_handle.hpp:67
dataspace base class
Definition dataspace.hpp:41
virtual hssize_t size() const
number of elements in the dataspace
data type object holder
Definition factory.hpp:54
const Datatype & get(const T &v=T{})
factory holder method for getting reference of data types
Definition factory.hpp:74
base class for all data types
Definition datatype.hpp:42
Class get_class() const
returns the datatypes class
virtual size_t size() const
get size of type in bytes
static Singleton & instance()
reference to singleton
Definition error.hpp:59
void throw_with_stack(const std::string &message)
throws an exception, potentially nested with error stack
file access property list
Definition file_access.hpp:78
dataset creation property list
Definition file_creation.hpp:38
void * ptr(T &value)
Definition type_trait.hpp:111
TypeTrait< T >::DataspaceType create(const T &value)
factory function for dataspaces
Definition type_trait.hpp:89
@ Integer
indicates an integer type
File open(const fs::path &path, AccessFlags flags=AccessFlags::ReadOnly, const property::FileAccessList &fapl=property::FileAccessList())
open an existing file
AccessFlags
flags controlling file opening and creation
Definition types.hpp:40
File from_buffer(T &data, ImageFlags flags=ImageFlags::ReadOnly)
load an image file from a buffer
Definition functions.hpp:126
ImageFlags
flags controlling image file opening and getting
Definition types.hpp:68
std::underlying_type< ImageFlags >::type ImageFlagsBase
Definition types.hpp:76
bool is_hdf5_file(const fs::path &path)
check if the file reference by the path is an HDF5 file
File create(const fs::path &path, AccessFlags flags=AccessFlags::Exclusive, const property::FileCreationList &fcpl=property::FileCreationList(), const property::FileAccessList &fapl=property::FileAccessList())
create a new file
std::underlying_type< AccessFlags >::type AccessFlagsBase
Definition types.hpp:52
top-level namespace of the entire library
Definition attribute.hpp:45
#define DLL_EXPORT
Definition windows.hpp:29