From 37a7f0b0aa8d44a08df99d783fcf42888fcaf0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Thu, 13 Dec 2012 22:42:56 -0300 Subject: [PATCH] Changed some String functions names. --- Makefile | 2 +- include/eepp/base/string.hpp | 12 ++++++------ projects/linux/ee.creator.user | 12 ++++++------ src/eepp/base/string.cpp | 12 ++++++------ src/eepp/graphics/cconsole.cpp | 8 ++++---- src/eepp/system/cinifile.cpp | 4 ++-- src/eepp/system/crc4.cpp | 14 +++++++------- src/eepp/system/filesystem.cpp | 2 +- src/eepp/ui/cuicommondialog.cpp | 2 +- src/eepp/window/backend/SDL2/cinputsdl2.cpp | 2 -- src/eepp/window/backend/allegro5/cinputal.cpp | 2 -- 11 files changed, 34 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index ba0ffb97e..7fbaae585 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ docs: doxygen ./Doxyfile clean: - $(RM) $(FOBJALL) $(DEPSALL) + $(RM) $(OBJDIR) cleantemp: @$(RM) $(FOBJEEPP) $(DEPSEEPP) diff --git a/include/eepp/base/string.hpp b/include/eepp/base/string.hpp index fd08a7469..b738db46c 100644 --- a/include/eepp/base/string.hpp +++ b/include/eepp/base/string.hpp @@ -72,10 +72,10 @@ class EE_API String { static bool IsLetter( const eeInt& mValue ); /** Split a String and hold it on a vector */ - static std::vector < String > SplitString ( const String& str, const Uint32& splitchar = '\n', const bool& pushEmptyString = false ); + static std::vector < String > Split( const String& str, const Uint32& splitchar = '\n', const bool& pushEmptyString = false ); /** Split a string and hold it on a vector */ - static std::vector < std::string > SplitString ( const std::string& str, const Int8& splitchar = '\n', const bool& pushEmptyString = false ); + static std::vector < std::string > Split( const std::string& str, const Int8& splitchar = '\n', const bool& pushEmptyString = false ); /** Remove the first space on the string */ static std::string LTrim( const std::string & str ); @@ -90,10 +90,10 @@ class EE_API String { static void ToLower( std::string & str ); /** Convert the string to an std::vector */ - static std::vector stringToUint8( const std::string& str ); + static std::vector StringToUint8( const std::string& str ); /** Convert the std::vector to an string */ - static std::string Uint8Tostring( const std::vector v ); + static std::string Uint8ToString( const std::vector v ); /** Insert a char into String on pos (added this function to avoid a bug on String) */ static void InsertChar( String& str, const eeUint& pos, const Uint32& tchar ); @@ -110,14 +110,14 @@ class EE_API String { * @param Str String to compare * @return The position of the last char compared ( -1 if fails ) */ - static Int32 StrStartsWith( const std::string& Start, const std::string Str ); + static Int32 StartsWith( const std::string& Start, const std::string Str ); /** Compare two strings from its beginning. * @param Start String start * @param Str String to compare * @return The position of the last char compared ( -1 if fails ) */ - static Int32 StrStartsWith( const String& Start, const String Str ); + static Int32 StartsWith( const String& Start, const String Str ); /** Replaces a substring by another string inside a string */ static void ReplaceSubStr(std::string &target, const std::string& that, const std::string& with ); diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 25517ff79..91201682b 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -48,9 +48,9 @@ Desktop Desktop {388e5431-b31b-42b3-b9ad-9002d279d75d} - 11 + 0 0 - 4 + 2 /home/programming/eepp @@ -177,7 +177,7 @@ false - -j4 -e DEBUGBUILD=yes SHARED_BACKEND=yes BACKENDS_ALL=yes es + -j4 -e DEBUGBUILD=yes true Make @@ -497,7 +497,7 @@ false - -j4 -e DEBUGBUILD=yes SHARED_BACKEND=yes BACKENDS_ALL=yes ew + -j4 -e DEBUGBUILD=yes true Make @@ -512,7 +512,7 @@ true - -e DEBUGBUILD=yes SHARED_BACKEND=yes BACKENDS_ALL=yes clean + -e DEBUGBUILD=yes /usr/bin/make %{buildDir} Custom Process Step diff --git a/src/eepp/base/string.cpp b/src/eepp/base/string.cpp index 4ebee8828..300021297 100644 --- a/src/eepp/base/string.cpp +++ b/src/eepp/base/string.cpp @@ -47,7 +47,7 @@ bool String::IsLetter( const eeInt& mValue ) { return ( ( (mValue >= 65 && mValue <= 90) || (mValue >= 97 && mValue <= 122) || (mValue >= 192 && mValue <= 255) ) && (mValue != 215) && (mValue != 247) ); } -std::vector < String > String::SplitString ( const String& str, const Uint32& splitchar, const bool& pushEmptyString ) { +std::vector < String > String::Split ( const String& str, const Uint32& splitchar, const bool& pushEmptyString ) { std::vector < String > tmp; String tmpstr; @@ -68,7 +68,7 @@ std::vector < String > String::SplitString ( const String& str, const Uint32& sp return tmp; } -std::vector < std::string > String::SplitString ( const std::string& str, const Int8& splitchar, const bool& pushEmptyString ) { +std::vector < std::string > String::Split ( const std::string& str, const Int8& splitchar, const bool& pushEmptyString ) { std::vector < std::string > tmp; std::string tmpstr; @@ -109,11 +109,11 @@ void String::ToLower( std::string & str ) { std::transform(str.begin(), str.end(), str.begin(), (int(*)(int)) std::tolower); } -std::vector String::stringToUint8( const std::string& str ) { +std::vector String::StringToUint8( const std::string& str ) { return std::vector( str.begin(), str.end() ); } -std::string String::Uint8Tostring( const std::vector v ) { +std::string String::Uint8ToString( const std::vector v ) { return std::string( v.begin(), v.end() ); } @@ -129,7 +129,7 @@ void String::StrCopy( char * Dst, const char * Src, eeUint DstSize ) { *Dst = 0; } -Int32 String::StrStartsWith( const std::string& Start, const std::string Str ) { +Int32 String::StartsWith( const std::string& Start, const std::string Str ) { Int32 Pos = -1; if ( Str.size() >= Start.size() ) { @@ -146,7 +146,7 @@ Int32 String::StrStartsWith( const std::string& Start, const std::string Str ) { return Pos; } -Int32 String::StrStartsWith( const String& Start, const String Str ) { +Int32 String::StartsWith( const String& Start, const String Str ) { Int32 Pos = -1; if ( Str.size() >= Start.size() ) { diff --git a/src/eepp/graphics/cconsole.cpp b/src/eepp/graphics/cconsole.cpp index 8306297c5..e2eceabd3 100755 --- a/src/eepp/graphics/cconsole.cpp +++ b/src/eepp/graphics/cconsole.cpp @@ -209,7 +209,7 @@ void cConsole::FadeOut() { void cConsole::ProcessLine() { String str = mTBuf->Buffer(); - std::vector < String > params = String::SplitString( str, ' ' ); + std::vector < String > params = String::Split( str, ' ' ); mLastCommands.push_back( str ); mLastLogPos = (eeInt)mLastCommands.size(); @@ -330,7 +330,7 @@ void cConsole::PrintCommandsStartingWith( const String& start ) { std::map < String, ConsoleCallback >::iterator it; for ( it = mCallbacks.begin(); it != mCallbacks.end(); it++ ) { - if ( -1 != String::StrStartsWith( start, it->first ) ) { + if ( -1 != String::StartsWith( start, it->first ) ) { cmds.push_back( it->first ); } } @@ -522,7 +522,7 @@ void cConsole::CmdFrameLimit ( const std::vector < String >& params ) { } void cConsole::CmdGetLog() { - std::vector < String > tvec = String::SplitString( String( String::ToStr( cLog::instance()->Buffer() ) ) ); + std::vector < String > tvec = String::Split( String( String::ToStr( cLog::instance()->Buffer() ) ) ); if ( tvec.size() > 0 ) { for ( eeUint i = 0; i < tvec.size(); i++ ) PushText( tvec[i] ); @@ -535,7 +535,7 @@ void cConsole::CmdGetLog( const std::vector < String >& params ) { void cConsole::CmdGetGpuExtensions() { char *Exts = GLi->GetExtensions(); - std::vector < String > tvec = String::SplitString( String( String::ToStr( std::string( Exts ) ) ), ' ' ); + std::vector < String > tvec = String::Split( String( String::ToStr( std::string( Exts ) ) ), ' ' ); if ( tvec.size() > 0 ) { for ( eeUint i = 0; i < tvec.size(); i++ ) PushText( tvec[i] ); diff --git a/src/eepp/system/cinifile.cpp b/src/eepp/system/cinifile.cpp index 407e5c778..7933ea64c 100755 --- a/src/eepp/system/cinifile.cpp +++ b/src/eepp/system/cinifile.cpp @@ -52,7 +52,7 @@ bool cIniFile::LoadFromMemory( const Uint8* RAWData, const Uint32& size ) { myfile.assign( reinterpret_cast (RAWData), size ); mLines.clear(); - mLines = String::SplitString( myfile ); + mLines = String::Split( myfile ); mIniReaded = false; @@ -73,7 +73,7 @@ bool cIniFile::LoadFromFile( const std::string& iniPath ) { f.Read( (char*)&myfile[0], f.GetSize() ); mLines.clear(); - mLines = String::SplitString( myfile ); + mLines = String::Split( myfile ); mIniReaded = false; diff --git a/src/eepp/system/crc4.cpp b/src/eepp/system/crc4.cpp index 5ffdd5d29..90acf146c 100644 --- a/src/eepp/system/crc4.cpp +++ b/src/eepp/system/crc4.cpp @@ -54,11 +54,11 @@ void cRC4::EncryptByte( std::vector& buffer ) { } void cRC4::EncryptString( std::string& buffer ) { - std::vector intbuf = String::stringToUint8( buffer ); + std::vector intbuf = String::StringToUint8( buffer ); EncryptByte( intbuf ); - buffer = String::Uint8Tostring( intbuf ); + buffer = String::Uint8ToString( intbuf ); } bool cRC4::EncryptFile( const std::string& SourceFile, const std::string& DestFile ) { @@ -108,11 +108,11 @@ bool cRC4::EncryptFile( const std::string& SourceFile, const std::string& DestFi } void cRC4::SetKey( const std::string& Key ) { - SetKey( String::stringToUint8( Key ) ); + SetKey( String::StringToUint8( Key ) ); } void cRC4::EncryptByte( std::vector& buffer, const std::string& Key ) { - EncryptByte( buffer, String::stringToUint8( Key ) ); + EncryptByte( buffer, String::StringToUint8( Key ) ); } void cRC4::DecryptByte( std::vector& buffer, const std::vector& Key ) { @@ -120,7 +120,7 @@ void cRC4::DecryptByte( std::vector& buffer, const std::vector& Ke } void cRC4::DecryptByte( std::vector& buffer, const std::string& Key ) { - EncryptByte( buffer, String::stringToUint8( Key ) ); + EncryptByte( buffer, String::StringToUint8( Key ) ); } void cRC4::DecryptByte( std::vector& buffer ) { @@ -128,7 +128,7 @@ void cRC4::DecryptByte( std::vector& buffer ) { } void cRC4::EncryptString( std::string& buffer, const std::string& Key ) { - EncryptString( buffer, String::stringToUint8( Key ) ); + EncryptString( buffer, String::StringToUint8( Key ) ); } void cRC4::DecryptString( std::string& buffer, const std::vector& Key ) { @@ -144,7 +144,7 @@ void cRC4::DecryptString( std::string& buffer ) { } bool cRC4::EncryptFile( const std::string& SourceFile, const std::string& DestFile, const std::string& Key ) { - return EncryptFile( SourceFile, DestFile, String::stringToUint8( Key ) ); + return EncryptFile( SourceFile, DestFile, String::StringToUint8( Key ) ); } bool cRC4::DecryptFile( const std::string& SourceFile, const std::string& DestFile ) { diff --git a/src/eepp/system/filesystem.cpp b/src/eepp/system/filesystem.cpp index e606cf2bf..4c5a871c8 100644 --- a/src/eepp/system/filesystem.cpp +++ b/src/eepp/system/filesystem.cpp @@ -115,7 +115,7 @@ std::string FileSystem::FileRemoveFileName( const std::string& filepath ) { void FileSystem::FilePathRemoveProcessPath( std::string& path ) { static std::string ProcessPath = Sys::GetProcessPath(); - Int32 pos = String::StrStartsWith( ProcessPath, path ); + Int32 pos = String::StartsWith( ProcessPath, path ); if ( -1 != pos && (Uint32)(pos + 1) < path.size() ) path = path.substr( pos + 1 ); diff --git a/src/eepp/ui/cuicommondialog.cpp b/src/eepp/ui/cuicommondialog.cpp index f137c2f2b..e7d99832f 100644 --- a/src/eepp/ui/cuicommondialog.cpp +++ b/src/eepp/ui/cuicommondialog.cpp @@ -168,7 +168,7 @@ void cUICommonDialog::RefreshFolder() { Uint32 i, z; if ( "*" != mFiletype->Text() ) { - patterns = String::SplitString( mFiletype->Text().ToUtf8(), ';' ); + patterns = String::Split( mFiletype->Text().ToUtf8(), ';' ); for ( i = 0; i < patterns.size(); i++ ) patterns[i] = FileSystem::FileExtension( patterns[i] ); diff --git a/src/eepp/window/backend/SDL2/cinputsdl2.cpp b/src/eepp/window/backend/SDL2/cinputsdl2.cpp index 13e2f1504..9a406be7b 100644 --- a/src/eepp/window/backend/SDL2/cinputsdl2.cpp +++ b/src/eepp/window/backend/SDL2/cinputsdl2.cpp @@ -29,8 +29,6 @@ void cInputSDL::Update() { CleanStates(); - /** @TODO: Filter by windowId */ - while ( SDL_PollEvent( &SDLEvent ) ) { switch( SDLEvent.type ) { case SDL_WINDOWEVENT: diff --git a/src/eepp/window/backend/allegro5/cinputal.cpp b/src/eepp/window/backend/allegro5/cinputal.cpp index c6cb39221..889652412 100644 --- a/src/eepp/window/backend/allegro5/cinputal.cpp +++ b/src/eepp/window/backend/allegro5/cinputal.cpp @@ -27,8 +27,6 @@ void cInputAl::Update() { CleanStates(); - /** @TODO: Filter by windowId */ - while ( al_get_next_event( mQueue, &ALEvent ) ) { switch ( ALEvent.type ) { case ALLEGRO_EVENT_KEY_CHAR: