Expose curl_easy_escape via KICAD_CURL_EASY

This commit is contained in:
Jon Evans 2020-02-20 20:58:51 -05:00
parent dc75c2b800
commit da1ba54188
2 changed files with 14 additions and 0 deletions

View File

@ -142,3 +142,14 @@ bool KICAD_CURL_EASY::SetFollowRedirects( bool aFollow )
} }
return false; return false;
} }
std::string KICAD_CURL_EASY::Escape( const std::string& aUrl )
{
char* escaped = curl_easy_escape( m_CURL, aUrl.c_str(), aUrl.length() );
std::string ret( escaped );
curl_free( escaped );
return ret;
}

View File

@ -126,6 +126,9 @@ public:
return m_buffer; return m_buffer;
} }
/// Escapes a string for use as a URL
std::string Escape( const std::string& aUrl );
private: private:
/** /**
* Function setOption * Function setOption