Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
FormURLEncoded/Writer.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_DataExchange_Variant_FormURLEncoded_Writer_h_
5#define _Stroika_Foundation_DataExchange_Variant_FormURLEncoded_Writer_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include "Stroika/Foundation/Common/Common.h"
10#include "Stroika/Foundation/Containers/Association.h"
14
15/**
16 * \file
17 *
18 * \note Code-Status: <a href="Code-Status.md#Beta">Beta</a>
19 *
20 */
21
22namespace Stroika::Foundation::DataExchange::Variant::FormURLEncoded {
23
24 using Containers::Association;
25 using Traversal::Iterable;
26
27 /**
28 * \brief Association (or VariantValue) to the output stream - following https://url.spec.whatwg.org/#application/x-www-form-urlencoded
29 *
30 * \see InternetMediaTypes::kWWWFormURLEncoded
31 *
32 * \par Example Usage
33 * \code
34 *
35 * \endcode
36 */
37 class Writer : public Variant::Writer {
38 private:
40
41 private:
42 class Rep_;
43
44 public:
45 /**
46 */
47 Writer ();
48
49 public:
50 /**
51 * @See Variant::Writer::Write, but overloaded to also take array of array of strings to write.
52 *
53 * \note Could have been called WriteMatrix (additional overloads) - but seemed best to emphasize connection
54 * to other Writers instead of similarity to Reader (where we call it ReadMatrix due to not being
55 * able to overload on return type).
56 */
57 using inherited::Write;
58 nonvirtual void Write (const Association<String, String>& m, const Streams::OutputStream::Ptr<byte>& out);
59
60 public:
61 /**
62 * @See Variant::Writer::WriteAsBLOB, but overloaded to also take array of array of strings to write.
63 */
65 [[nodiscard]] nonvirtual Memory::BLOB WriteAsBLOB (const Association<String, String>& m);
66
67 private:
68 nonvirtual shared_ptr<Rep_> GetRep_ () const;
69 };
70
71}
72
73/*
74 ********************************************************************************
75 ***************************** Implementation Details ***************************
76 ********************************************************************************
77 */
78#include "Writer.inl"
79
80#endif /*_Stroika_Foundation_DataExchange_Variant_FormURLEncoded_Writer_h_*/
An Association pairs key values with (possibly multiple or none) mapped_type values....
Association (or VariantValue) to the output stream - following https://url.spec.whatwg....
abstract class specifying interface for writers VariantValue objects to serialized formats like JSON,...
Definition Writer.h:37
nonvirtual Memory::BLOB WriteAsBLOB(const VariantValue &v) const
Definition Writer.cpp:48
nonvirtual void Write(const VariantValue &v, const Streams::OutputStream::Ptr< byte > &out) const
Definition Writer.inl:30
OutputStream<>::Ptr is Smart pointer to a stream-based sink of data.