This commit is contained in:
twinaphex 2015-07-25 00:59:57 +02:00
parent d20a4d57ad
commit 7005abc361
2 changed files with 0 additions and 56 deletions

View File

@ -29,8 +29,6 @@
#include "md5.h" #include "md5.h"
using namespace std;
const char * GetFNComponent(const char *str) const char * GetFNComponent(const char *str)
{ {
const char *tp1; const char *tp1;
@ -53,51 +51,3 @@ const char * GetFNComponent(const char *str)
else else
return (str); return (str);
} }
// Remove whitespace from beginning of string
void MDFN_ltrim(char *string)
{
int32 di, si;
bool InWhitespace = TRUE;
di = si = 0;
while(string[si])
{
if(InWhitespace && (string[si] == ' ' || string[si] == '\r' || string[si] == '\n' || string[si] == '\t' || string[si] == 0x0b))
{
}
else
{
InWhitespace = FALSE;
string[di] = string[si];
di++;
}
si++;
}
string[di] = 0;
}
// Remove whitespace from end of string
void MDFN_rtrim(char *string)
{
int32 len = strlen(string);
if(len)
{
for(int32 x = len - 1; x >= 0; x--)
{
if(string[x] == ' ' || string[x] == '\r' || string[x] == '\n' || string[x] == '\t' || string[x] == 0x0b)
string[x] = 0;
else
break;
}
}
}
void MDFN_trim(char *string)
{
MDFN_rtrim(string);
MDFN_ltrim(string);
}

View File

@ -3,16 +3,10 @@
#include <string> #include <string>
extern uint32 MDFN_RoundUpPow2(uint32);
void GetFileBase(const char *f); void GetFileBase(const char *f);
std::string MDFN_MakeFName(int type, int id1, const char *cd1); std::string MDFN_MakeFName(int type, int id1, const char *cd1);
void MDFN_ltrim(char *string);
void MDFN_rtrim(char *string);
void MDFN_trim(char *string);
typedef enum typedef enum
{ {
MDFNMKF_STATE = 0, MDFNMKF_STATE = 0,