v1.0.0-rc.81
This commit is contained in:
+13
-2
@@ -827,6 +827,17 @@ std::string ExtractFilename(const std::string& str) {
|
||||
return path.filename();
|
||||
}
|
||||
|
||||
bool HDF5Object::GetBool(const std::string &name) const {
|
||||
HDF5DataSet dataset(*this, name);
|
||||
return dataset.ReadScalar<bool>();
|
||||
}
|
||||
|
||||
std::optional<bool> HDF5Object::GetOptBool(const std::string &name) const {
|
||||
if (Exists(name))
|
||||
return GetBool(name);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
float HDF5Object::GetFloat(const std::string &name) const {
|
||||
HDF5DataSet dataset(*this, name);
|
||||
return dataset.ReadScalar<float>();
|
||||
@@ -840,13 +851,13 @@ int64_t HDF5Object::GetInt(const std::string &name) const {
|
||||
std::optional<float> HDF5Object::GetOptFloat(const std::string &name) const {
|
||||
if (Exists(name))
|
||||
return GetFloat(name);
|
||||
return {};
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<int64_t> HDF5Object::GetOptInt(const std::string &name) const {
|
||||
if (Exists(name))
|
||||
return GetInt(name);
|
||||
return {};
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::string HDF5Object::GetString(const std::string &name, const std::string &def) const {
|
||||
|
||||
Reference in New Issue
Block a user