:relfileprefix: ../../../
[#boost-urls-decode_view-2constructor-03]

= xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/decode_view.adoc[pass:[decode_view]]::decode_view


Constructor


== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/decode_view.hpp#L209[boost/url/decode_view.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
explicit
decode_view(
    xref:boost/urls/pct_string_view.adoc[pct_string_view] s,
    xref:boost/urls/encoding_opts.adoc[encoding_opts] opt = = {}) noexcept;
----

== Description


This constructs a view from the character
buffer `s`, which must remain valid and
unmodified until the view is no longer
accessed.

=== Example
[,cpp]
----
decode_view ds( "Program%20Files" );
----

=== Postconditions
[,cpp]
----
this->encoded() == s
----

=== Complexity

Linear in `s.size()`.

=== Exception Safety

Exceptions thrown on invalid input.



== Exceptions

|===
| Name | Thrown on

| `system_error`
| 
The string contains an invalid percent encoding.

|===



== Parameters

|===
| Name | Description 

| *s*
| 
A percent-encoded string that has
already been validated.

| *opt*
| 
The options for decoding. If
this parameter is omitted, the default
options are used.

|===




