[Opalvoip-svn] SF.net SVN: opalvoip:[20764] ptlib/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2008-08-29 02:15:09
|
Revision: 20764 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=20764&view=rev Author: rjongbloed Date: 2008-08-29 02:15:19 +0000 (Fri, 29 Aug 2008) Log Message: ----------- Exposed internal function for splitting vars and params. Modified Paths: -------------- ptlib/trunk/include/ptclib/url.h ptlib/trunk/src/ptclib/url.cxx Modified: ptlib/trunk/include/ptclib/url.h =================================================================== --- ptlib/trunk/include/ptclib/url.h 2008-08-29 01:06:49 UTC (rev 20763) +++ ptlib/trunk/include/ptclib/url.h 2008-08-29 02:15:19 UTC (rev 20764) @@ -186,13 +186,22 @@ TranslationType type ///< Type of translation. ); + /** Split a string to a dictionary of names and values. */ + static void SplitVars( + const PString & str, ///< String to split into variables. + PStringToString & vars, ///< Dictionary of variable names and values. + char sep1, ///< Separater between pairs + char sep2 ///< Separater between key and value + ); + /** Split a string in &= form to a dictionary of names and values. */ static void SplitQueryVars( const PString & queryStr, ///< String to split into variables. PStringToString & queryVars ///< Dictionary of variable names and values. - ); + ) { SplitVars(queryStr, queryVars, '&', '='); } + /// Get the scheme field of the URL. const PCaselessString & GetScheme() const { return scheme; } Modified: ptlib/trunk/src/ptclib/url.cxx =================================================================== --- ptlib/trunk/src/ptclib/url.cxx 2008-08-29 01:06:49 UTC (rev 20763) +++ ptlib/trunk/src/ptclib/url.cxx 2008-08-29 02:15:19 UTC (rev 20764) @@ -261,7 +261,7 @@ } -static void SplitVars(const PString & str, PStringToString & vars, char sep1, char sep2) +void PURL::SplitVars(const PString & str, PStringToString & vars, char sep1, char sep2) { vars.RemoveAll(); @@ -290,12 +290,6 @@ } -void PURL::SplitQueryVars(const PString & queryStr, PStringToString & queryVars) -{ - SplitVars(queryStr, queryVars, '&', '='); -} - - PBoolean PURL::InternalParse(const char * cstr, const char * defaultScheme) { urlString = cstr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |