~holger-seelig/titania/0.7.5

« back to all changes in this revision

Viewing changes to libtitania-standard/Titania/Basic/URI.h

  • Committer: Holger Seelig
  • Date: 2014-10-23 02:45:38 UTC
  • Revision ID: holger.seelig@yahoo.de-20141023024538-d7ej5te3ceo8a3f5
Escape url's right before sending an curl request.

Show diffs side-by-side

added added

removed removed

Lines of Context:
845
845
basic_uri <StringT>
846
846
basic_uri <StringT>::escape () const
847
847
{
848
 
        if (is_local () and is_absolute ())
849
 
        {
850
 
                return basic_uri ({ is_local (),
851
 
                                    is_absolute (),
852
 
                                    scheme (),
853
 
                                    value .slashs,
854
 
                                    authority (),
855
 
                                    host (),
856
 
                                    port (),
857
 
                                    basic_path <string_type> (path (), string_type (1, Signs::Slash)) .escape () .str (),
858
 
                                    query (),
859
 
                                    fragment () });
860
 
        }
861
 
 
862
 
        return *this;
 
848
        return basic_uri ({ is_local (),
 
849
                            is_absolute (),
 
850
                            scheme (),
 
851
                            value .slashs,
 
852
                            authority (),
 
853
                            host (),
 
854
                            port (),
 
855
                            basic_path <string_type> (path (), string_type (1, Signs::Slash)) .escape () .str (),
 
856
                            query (),
 
857
                            fragment () });
863
858
}
864
859
 
865
860
template <class StringT>
866
861
basic_uri <StringT>
867
862
basic_uri <StringT>::unescape () const
868
863
{
869
 
        if (is_local () and is_absolute ())
870
 
        {
871
 
                return basic_uri ({ is_local (),
872
 
                                    is_absolute (),
873
 
                                    scheme (),
874
 
                                    value .slashs,
875
 
                                    authority (),
876
 
                                    host (),
877
 
                                    port (),
878
 
                                    basic_path <string_type> (path (), string_type (1, Signs::Slash)) .unescape () .str (),
879
 
                                    query (),
880
 
                                    fragment () });
881
 
        }
882
 
 
883
 
        return *this;
 
864
        return basic_uri ({ is_local (),
 
865
                            is_absolute (),
 
866
                            scheme (),
 
867
                            value .slashs,
 
868
                            authority (),
 
869
                            host (),
 
870
                            port (),
 
871
                            basic_path <string_type> (path (), string_type (1, Signs::Slash)) .unescape () .str (),
 
872
                            query (),
 
873
                            fragment () });
884
874
}
885
875
 
886
876
// Private Funtions