move URLEncode into RageUtil
This commit is contained in:
@@ -934,6 +934,20 @@ bool EndsWith( const RString &sTestThis, const RString &sEnding )
|
||||
return sTestThis.compare( sTestThis.length()-sEnding.length(), sEnding.length(), sEnding ) == 0;
|
||||
}
|
||||
|
||||
RString URLEncode( const RString &sStr )
|
||||
{
|
||||
RString sOutput;
|
||||
for( unsigned k = 0; k < sStr.size(); k++ )
|
||||
{
|
||||
char t = sStr[k];
|
||||
if( t >= '!' && t <= 'z' )
|
||||
sOutput += t;
|
||||
else
|
||||
sOutput += "%" + ssprintf( "%X", t );
|
||||
}
|
||||
return sOutput;
|
||||
}
|
||||
|
||||
void StripCvs( vector<RString> &vs )
|
||||
{
|
||||
for( unsigned i=0; i<vs.size(); i++ )
|
||||
|
||||
@@ -346,6 +346,7 @@ void TrimRight( RString &sStr, const char *szTrim = "\r\n\t " );
|
||||
void StripCrnl( RString &sStr );
|
||||
bool BeginsWith( const RString &sTestThis, const RString &sBeginning );
|
||||
bool EndsWith( const RString &sTestThis, const RString &sEnding );
|
||||
RString URLEncode( const RString &sStr );
|
||||
|
||||
void StripCvs( vector<RString> &vs ); // remove all items that end in "cvs"
|
||||
|
||||
|
||||
@@ -385,20 +385,6 @@ void ScreenPackages::HTMLParse()
|
||||
UpdateLinksList();
|
||||
}
|
||||
|
||||
RString ScreenPackages::URLEncode( const RString &sInput )
|
||||
{
|
||||
RString sOutput;
|
||||
for( unsigned k = 0; k < sInput.size(); k++ )
|
||||
{
|
||||
char t = sInput[k];
|
||||
if( t >= '!' && t <= 'z' )
|
||||
sOutput += t;
|
||||
else
|
||||
sOutput += "%" + ssprintf( "%X", t );
|
||||
}
|
||||
return sOutput;
|
||||
}
|
||||
|
||||
RString ScreenPackages::StripOutContainers( const RString & In )
|
||||
{
|
||||
if( In.size() == 0 )
|
||||
|
||||
@@ -33,7 +33,6 @@ private:
|
||||
|
||||
void HTMLParse();
|
||||
|
||||
RString URLEncode( const RString &URL ); //Encode any string in URL-style
|
||||
RString StripOutContainers( const RString & In ); //Strip off "'s and ''s
|
||||
|
||||
Sprite m_sprExistingBG;
|
||||
|
||||
Reference in New Issue
Block a user