Added XML support; #21

This commit is contained in:
Patrick Urbanke
2023-12-20 21:07:36 +01:00
parent 2281849dde
commit c5347eee28
124 changed files with 4652 additions and 1437 deletions
+20
View File
@@ -0,0 +1,20 @@
#ifndef RFL_XML_LOAD_HPP_
#define RFL_XML_LOAD_HPP_
#include "rfl/Result.hpp"
#include "rfl/io/load_string.hpp"
#include "rfl/xml/read.hpp"
namespace rfl {
namespace xml {
template <class T>
Result<T> load(const std::string& _fname) {
const auto read_string = [](const auto& _str) { return read<T>(_str); };
return rfl::io::load_string(_fname).and_then(read_string);
}
} // namespace xml
} // namespace rfl
#endif