Skip to content

Using input_adapter in a slightly unexpected way #834

Closed
@chetmurthy

Description

Feature Request

I'm trying to use input_adapter to wrap an Apache Thrift Transport (the details aren't really relevant). To that end, I need to provide the json::parse() function my own subclass of input_adapter_protocol, instead of an input_adapter. I'm happy to send a PR, but figured I should at least first check that this isn't something foolish, or something that can be achieved in another way? It was extremely straightforward to make my own subclass of input_adapter_protocol, btw.

modified   src/lib/cpp/json.hpp
@@ -1562,6 +1562,8 @@ class input_adapter
   public:
     // native support
 
+  explicit input_adapter(input_adapter_t arg_ia) : ia(arg_ia) { }
+
     /// input adapter for input stream
     input_adapter(std::istream& i)
         : ia(std::make_shared<cached_input_stream_adapter<16384>>(i)) {}

Metadata

Assignees

Labels

kind: enhancement/improvementstate: please discussplease discuss the issue or vote for your favorite optionstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions