move URLEncode into RageUtil

This commit is contained in:
Glenn Maynard
2006-02-09 00:08:10 +00:00
parent c1848ab4a5
commit 478de001c6
4 changed files with 15 additions and 15 deletions
+14
View File
@@ -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++ )
+1
View File
@@ -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"
-14
View File
@@ -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 )
-1
View File
@@ -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;