mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-19 03:53:57 +03:00
Changed some String functions names.
This commit is contained in:
@@ -157,7 +157,7 @@ docs:
|
||||
doxygen ./Doxyfile
|
||||
|
||||
clean:
|
||||
$(RM) $(FOBJALL) $(DEPSALL)
|
||||
$(RM) $(OBJDIR)
|
||||
|
||||
cleantemp:
|
||||
@$(RM) $(FOBJEEPP) $(DEPSEEPP)
|
||||
|
||||
@@ -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<Uint8> */
|
||||
static std::vector<Uint8> stringToUint8( const std::string& str );
|
||||
static std::vector<Uint8> StringToUint8( const std::string& str );
|
||||
|
||||
/** Convert the std::vector<Uint8> to an string */
|
||||
static std::string Uint8Tostring( const std::vector<Uint8> v );
|
||||
static std::string Uint8ToString( const std::vector<Uint8> 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 );
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by Qt Creator 2.6.0, 2012-12-13T13:15:04. -->
|
||||
<!-- Written by Qt Creator 2.6.0, 2012-12-13T22:42:08. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
@@ -48,9 +48,9 @@
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
|
||||
<value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">{388e5431-b31b-42b3-b9ad-9002d279d75d}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">11</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">4</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">2</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="QString" key="GenericProjectManager.GenericBuildConfiguration.BuildDirectory">/home/programming/eepp</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
@@ -177,7 +177,7 @@
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets"/>
|
||||
<value type="bool" key="GenericProjectManager.GenericMakeStep.Clean">false</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments">-j4 -e DEBUGBUILD=yes SHARED_BACKEND=yes BACKENDS_ALL=yes es</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments">-j4 -e DEBUGBUILD=yes</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
@@ -497,7 +497,7 @@
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets"/>
|
||||
<value type="bool" key="GenericProjectManager.GenericMakeStep.Clean">false</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments">-j4 -e DEBUGBUILD=yes SHARED_BACKEND=yes BACKENDS_ALL=yes ew</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeArguments">-j4 -e DEBUGBUILD=yes</value>
|
||||
<value type="QString" key="GenericProjectManager.GenericMakeStep.MakeCommand"></value>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
|
||||
@@ -512,7 +512,7 @@
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">-e DEBUGBUILD=yes SHARED_BACKEND=yes BACKENDS_ALL=yes clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">-e DEBUGBUILD=yes</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Command">/usr/bin/make</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
|
||||
|
||||
@@ -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<Uint8> String::stringToUint8( const std::string& str ) {
|
||||
std::vector<Uint8> String::StringToUint8( const std::string& str ) {
|
||||
return std::vector<Uint8>( str.begin(), str.end() );
|
||||
}
|
||||
|
||||
std::string String::Uint8Tostring( const std::vector<Uint8> v ) {
|
||||
std::string String::Uint8ToString( const std::vector<Uint8> 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() ) {
|
||||
|
||||
@@ -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] );
|
||||
|
||||
@@ -52,7 +52,7 @@ bool cIniFile::LoadFromMemory( const Uint8* RAWData, const Uint32& size ) {
|
||||
myfile.assign( reinterpret_cast<const char*> (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;
|
||||
|
||||
|
||||
@@ -54,11 +54,11 @@ void cRC4::EncryptByte( std::vector<Uint8>& buffer ) {
|
||||
}
|
||||
|
||||
void cRC4::EncryptString( std::string& buffer ) {
|
||||
std::vector<Uint8> intbuf = String::stringToUint8( buffer );
|
||||
std::vector<Uint8> 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<Uint8>& buffer, const std::string& Key ) {
|
||||
EncryptByte( buffer, String::stringToUint8( Key ) );
|
||||
EncryptByte( buffer, String::StringToUint8( Key ) );
|
||||
}
|
||||
|
||||
void cRC4::DecryptByte( std::vector<Uint8>& buffer, const std::vector<Uint8>& Key ) {
|
||||
@@ -120,7 +120,7 @@ void cRC4::DecryptByte( std::vector<Uint8>& buffer, const std::vector<Uint8>& Ke
|
||||
}
|
||||
|
||||
void cRC4::DecryptByte( std::vector<Uint8>& buffer, const std::string& Key ) {
|
||||
EncryptByte( buffer, String::stringToUint8( Key ) );
|
||||
EncryptByte( buffer, String::StringToUint8( Key ) );
|
||||
}
|
||||
|
||||
void cRC4::DecryptByte( std::vector<Uint8>& buffer ) {
|
||||
@@ -128,7 +128,7 @@ void cRC4::DecryptByte( std::vector<Uint8>& 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<Uint8>& 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 ) {
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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] );
|
||||
|
||||
@@ -29,8 +29,6 @@ void cInputSDL::Update() {
|
||||
|
||||
CleanStates();
|
||||
|
||||
/** @TODO: Filter by windowId */
|
||||
|
||||
while ( SDL_PollEvent( &SDLEvent ) ) {
|
||||
switch( SDLEvent.type ) {
|
||||
case SDL_WINDOWEVENT:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user