text: (window.webpackJsonp=window.webpackJsonp||[]).push([[181],{553:function(t,a,r){"use strict";r.r(a);var s=r(42),e=Object(s.a)({},(function(){var t=this,a=t.$createElement,r=t._self._c||a;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"multipart-hpp"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-hpp"}},[t._v("#")]),t._v(" Multipart.hpp"),r("seo")],1),t._v(" "),r("p",[r("a",{attrs:{href:"https://github.com/oatpp/oatpp/blob/master/src/oatpp/web/mime/multipart/Multipart.hpp",target:"_blank",rel:"noopener noreferrer"}},[t._v("This File On Github"),r("OutboundLink")],1),r("br"),t._v(" "),r("a",{attrs:{href:"https://github.com/oatpp/oatpp/issues/new?title=API%20question&body=In%20file:%20oatpp/web/mime/multipart/Multipart.hpp%0A%0A%23%20Question%0A%0A%3Cyour-question-here%3E",target:"_blank",rel:"noopener noreferrer"}},[t._v("Ask A Question"),r("OutboundLink")],1)]),t._v(" "),r("p",[r("code",[t._v("API: latest")]),r("br"),t._v(" "),r("code",[t._v("module: oatpp")]),r("br"),t._v(" "),r("code",[t._v('#include "oatpp/web/mime/multipart/Multipart.hpp"')])]),t._v(" "),r("h2",{attrs:{id:"headers"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#headers"}},[t._v("#")]),t._v(" Headers")]),t._v(" "),r("p",[r("strong",[t._v("Namespace:")]),t._v(" "),r("code",[t._v("oatpp::web::mime::multipart")])]),t._v(" "),r("p",[t._v("Typedef for headers map. Headers map key is case-insensitive. For more info see "),r("RouterLink",{attrs:{to:"/api/latest/oatpp/core/data/share/LazyStringMap/#lazystringmap"}},[t._v("oatpp::data::share::LazyStringMap")]),t._v(".")],1),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typedef")]),t._v(" oatpp"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("data"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("share"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("LazyStringMap"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("oatpp"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("data"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("share"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("StringKeyLabelCI_FAST"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" Headers\n")])])]),r("h2",{attrs:{id:"multipart"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart"}},[t._v("#")]),t._v(" Multipart")]),t._v(" "),r("p",[t._v("Structure that holds parts of Multipart.")]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" oatpp "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" web "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" mime "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("namespace")]),t._v(" multipart "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n  "),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Multipart")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),r("h3",{attrs:{id:"methods"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),r("table",[r("thead",[r("tr",[r("th",[t._v("Return Type")]),t._v(" "),r("th",[t._v("Name")]),t._v(" "),r("th",[t._v("Summary")])])]),t._v(" "),r("tbody",[r("tr",[r("td",[r("code",[t._v("[none]")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-multipart"}},[t._v("Multipart")])]),t._v(" "),r("td",[t._v("Multiple implementations: "),r("br"),r("ol",[r("li",[t._v("Constructor. ")]),r("li",[t._v("Constructor. ")])])])]),t._v(" "),r("tr",[r("td",[r("code",[t._v("[none]")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-~multipart"}},[t._v("~Multipart")])]),t._v(" "),r("td",[t._v("Default virtual Destructor.")])]),t._v(" "),r("tr",[r("td",[r("code",[t._v("std::shared_ptr<Multipart>")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-createsharedwithrandomboundary"}},[t._v("createSharedWithRandomBoundary")])]),t._v(" "),r("td",[t._v("Create Multipart object with random boundary. "),r("br")])]),t._v(" "),r("tr",[r("td",[r("code",[t._v("oatpp::String")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-getboundary"}},[t._v("getBoundary")])]),t._v(" "),r("td",[t._v("Get multipart boundary value.")])]),t._v(" "),r("tr",[r("td",[r("code",[t._v("void")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-addpart"}},[t._v("addPart")])]),t._v(" "),r("td",[t._v("Add part to Multipart.")])]),t._v(" "),r("tr",[r("td",[r("code",[t._v("std::shared_ptr<Part>")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-getnamedpart"}},[t._v("getNamedPart")])]),t._v(" "),r("td",[t._v("Get part by name "),r("br")])]),t._v(" "),r("tr",[r("td",[r("code",[t._v("const std::list<std::shared_ptr<Part>>&")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-getallparts"}},[t._v("getAllParts")])]),t._v(" "),r("td",[t._v("Get list of all parts.")])]),t._v(" "),r("tr",[r("td",[r("code",[t._v("v_int64")])]),t._v(" "),r("td",[r("a",{attrs:{href:"#multipart-count"}},[t._v("count")])]),t._v(" "),r("td",[t._v("Get parts count.")])])])]),t._v(" "),r("h3",{attrs:{id:"multipart-multipart"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-multipart"}},[t._v("#")]),t._v(" Multipart::Multipart")]),t._v(" "),r("ol",[r("li",[t._v("Constructor. "),r("ul",[r("li",[r("strong",[t._v("@param")]),t._v(" boundary - multipart boundary value. ")])]),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token function"}},[t._v("Multipart")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" oatpp"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("String"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" boundary"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])]),t._v(" "),r("li",[t._v("Constructor. "),r("ul",[r("li",[r("strong",[t._v("@param")]),t._v(' requestHeaders - request headers. Headers must contain "Content-Type" header. ')])]),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token function"}},[t._v("Multipart")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" Headers"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" requestHeaders"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])]),t._v(" "),r("h3",{attrs:{id:"multipart-multipart-2"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-multipart-2"}},[t._v("#")]),t._v(" Multipart::~Multipart")]),t._v(" "),r("p",[t._v("Default virtual Destructor.")]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("virtual")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("~")]),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("Multipart")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v("\n")])])]),r("h3",{attrs:{id:"multipart-createsharedwithrandomboundary"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-createsharedwithrandomboundary"}},[t._v("#")]),t._v(" Multipart::createSharedWithRandomBoundary")]),t._v(" "),r("p",[t._v("Create Multipart object with random boundary. "),r("br"),t._v(" It will generate random vector of size "),r("code",[t._v("boundarySize")]),t._v(" in bytes encoded in base64. "),r("ul",[r("li",[r("strong",[t._v("@param")]),t._v(" boundarySize - size of the random vecrot in bytes. ")]),r("li",[r("strong",[t._v("@return")]),t._v(" - "),r("code",[t._v("std::shared_ptr")]),t._v(" to Multipart. ")])])]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" std"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Multipart"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("createSharedWithRandomBoundary")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("v_int32 boundarySize "),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),r("h3",{attrs:{id:"multipart-getboundary"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-getboundary"}},[t._v("#")]),t._v(" Multipart::getBoundary")]),t._v(" "),r("p",[t._v("Get multipart boundary value. "),r("ul",[r("li",[r("strong",[t._v("@return")]),t._v(" - multipart boundary value. ")])])]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[t._v("oatpp"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("String "),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBoundary")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),r("h3",{attrs:{id:"multipart-addpart"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-addpart"}},[t._v("#")]),t._v(" Multipart::addPart")]),t._v(" "),r("p",[t._v("Add part to Multipart. "),r("ul",[r("li",[r("strong",[t._v("@param")]),t._v(" part - "),r("RouterLink",{attrs:{to:"/api/latest/oatpp/web/mime/multipart/Part/#part"}},[t._v("oatpp::web::mime::multipart::Part")]),t._v(". ")],1)])]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("addPart")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Part"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" part"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),r("h3",{attrs:{id:"multipart-getnamedpart"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-getnamedpart"}},[t._v("#")]),t._v(" Multipart::getNamedPart")]),t._v(" "),r("p",[t._v("Get part by name "),r("br"),t._v(" Applicable to named parts only. "),r("ul",[r("li",[r("strong",[t._v("@param")]),t._v(" name - "),r("RouterLink",{attrs:{to:"/api/latest/oatpp/core/Types/#string"}},[t._v("oatpp::String")]),t._v(". ")],1),r("li",[r("strong",[t._v("@return")]),t._v(" - "),r("RouterLink",{attrs:{to:"/api/latest/oatpp/web/mime/multipart/Part/#part"}},[t._v("oatpp::web::mime::multipart::Part")]),t._v(". ")],1)])]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[t._v("std"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Part"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNamedPart")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" oatpp"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("String"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" name"),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),r("h3",{attrs:{id:"multipart-getallparts"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-getallparts"}},[t._v("#")]),t._v(" Multipart::getAllParts")]),t._v(" "),r("p",[t._v("Get list of all parts. "),r("ul",[r("li",[r("strong",[t._v("@return")]),t._v(" - "),r("code",[t._v("std::list")]),t._v(" of "),r("code",[t._v("std::shared_ptr")]),t._v(" to "),r("RouterLink",{attrs:{to:"/api/latest/oatpp/web/mime/multipart/Part/#part"}},[t._v("oatpp::web::mime::multipart::Part")]),t._v(". ")],1)])]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[r("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" std"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("list"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("std"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("shared_ptr"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Part"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("getAllParts")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),r("h3",{attrs:{id:"multipart-count"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#multipart-count"}},[t._v("#")]),t._v(" Multipart::count")]),t._v(" "),r("p",[t._v("Get parts count. "),r("ul",[r("li",[r("strong",[t._v("@return")]),t._v(" - parts count. ")])])]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[t._v("v_int64 "),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("count")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),r("h2",{attrs:{id:"generaterandomboundary"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#generaterandomboundary"}},[t._v("#")]),t._v(" generateRandomBoundary")]),t._v(" "),r("p",[r("strong",[t._v("Namespace:")]),t._v(" "),r("code",[t._v("oatpp::web::mime::multipart")])]),t._v(" "),r("p",[t._v("Generate random boundary for Multipart object. Base64 encoded. "),r("ul",[r("li",[r("strong",[t._v("@param")]),t._v(" boundarySize - size in bytes of random vector. ")]),r("li",[r("strong",[t._v("@return")]),t._v(" - "),r("RouterLink",{attrs:{to:"/api/latest/oatpp/core/Types/#string"}},[t._v("oatpp::String")]),t._v(". ")],1)])]),t._v(" "),r("div",{staticClass:"language-cpp extra-class"},[r("pre",{pre:!0,attrs:{class:"language-cpp"}},[r("code",[t._v("oatpp"),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v("String "),r("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateRandomBoundary")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("v_int32 boundarySize "),r("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),r("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),r("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=e.exports}}]);