File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,24 @@ namespace web { namespace http
151151 return *this ;
152152 }
153153
154+ // / <summary>
155+ // / Set the port component of the URI.
156+ // / </summary>
157+ // / <param name="port">Port as a string.</param>
158+ // / <returns>A reference to this <c>uri_builder</c> to support chaining.</returns>
159+ // / <remarks>When string can't be converted to an integer the port is left unchanged.</remarks>
160+ uri_builder & set_port (const utility::string_t &port)
161+ {
162+ utility::istringstream_t portStream (port);
163+ portStream >> m_uri.m_port ;
164+ if (portStream.fail () || portStream.bad ())
165+ {
166+ throw std::invalid_argument (" invalid port argument, must be non empty string containing integer value" );
167+ }
168+
169+ return *this ;
170+ }
171+
154172 // / <summary>
155173 // / Set the path component of the URI.
156174 // / </summary>
You can’t perform that action at this time.
0 commit comments