mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-07 03:06:18 +08:00
Remove Result<c-array>.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "../internal/get_type_name.hpp"
|
||||
#include "../internal/remove_namespaces.hpp"
|
||||
#include "../wrap_in_rfl_array_t.hpp"
|
||||
#include "Parser.hpp"
|
||||
#include "Reader.hpp"
|
||||
|
||||
@@ -17,14 +18,14 @@ using InputVarType = typename Reader::InputVarType;
|
||||
|
||||
/// Parses an object from a XML var.
|
||||
template <class T>
|
||||
Result<T> read(const InputVarType& _var) {
|
||||
Result<wrap_in_rfl_array_t<T>> read(const InputVarType& _var) {
|
||||
const auto r = Reader();
|
||||
return Parser<T>::read(r, _var);
|
||||
}
|
||||
|
||||
/// Parses an object from XML using reflection.
|
||||
template <class T>
|
||||
Result<T> read(const std::string& _xml_str) {
|
||||
Result<wrap_in_rfl_array_t<T>> read(const std::string& _xml_str) {
|
||||
pugi::xml_document doc;
|
||||
const auto result = doc.load_string(_xml_str.c_str());
|
||||
if (!result) {
|
||||
@@ -37,7 +38,7 @@ Result<T> read(const std::string& _xml_str) {
|
||||
|
||||
/// Parses an object from a stringstream.
|
||||
template <class T>
|
||||
Result<T> read(std::istream& _stream) {
|
||||
Result<wrap_in_rfl_array_t<T>> read(std::istream& _stream) {
|
||||
const auto xml_str = std::string(std::istreambuf_iterator<char>(_stream),
|
||||
std::istreambuf_iterator<char>());
|
||||
return read<T>(xml_str);
|
||||
|
||||
Reference in New Issue
Block a user