1994-08-19 07:10:19 +00:00
|
|
|
#ifndef __UTILITY_H
|
|
|
|
#define __UTILITY_H
|
|
|
|
|
1998-02-24 10:37:28 +00:00
|
|
|
#ifndef __STDTYPES_H
|
|
|
|
#include <stdtypes.h>
|
1994-08-19 07:10:19 +00:00
|
|
|
#endif
|
|
|
|
|
1998-02-24 10:37:28 +00:00
|
|
|
class TString_array;
|
1998-05-04 08:17:15 +00:00
|
|
|
class TFilename;
|
1998-02-24 10:37:28 +00:00
|
|
|
|
1994-08-19 07:10:19 +00:00
|
|
|
char* format (const char* fmt, ...);
|
|
|
|
const char* cmd2name(const char* argv0, const char* argv1 = "");
|
|
|
|
int rtoi(const char * roman);
|
|
|
|
const char* itor(int i);
|
1995-02-02 11:56:16 +00:00
|
|
|
bool fcopy(const char* orig, const char* dest, bool append=FALSE);
|
1994-08-19 07:10:19 +00:00
|
|
|
bool fexist(const char* file);
|
1997-10-30 16:14:49 +00:00
|
|
|
long fsize(const char* file);
|
1995-03-22 09:07:04 +00:00
|
|
|
|
2004-03-12 15:35:52 +00:00
|
|
|
bool make_dir(const char* dir);
|
|
|
|
bool remove_file(const char* file);
|
1997-10-09 13:31:51 +00:00
|
|
|
int list_files(const char* mask, TString_array& result);
|
1998-03-13 10:44:43 +00:00
|
|
|
bool input_filename(TFilename& file);
|
1998-01-28 09:24:17 +00:00
|
|
|
|
|
|
|
const char* encode(const char* data);
|
|
|
|
const char* decode(const char* data);
|
1996-02-05 19:00:53 +00:00
|
|
|
|
2003-10-07 12:53:38 +00:00
|
|
|
inline bool is_slash(char s) // @parm Carattere da confrontare
|
|
|
|
{ return s == '\\' || s == '/'; }
|
|
|
|
|
|
|
|
inline bool is_not_slash(char s) // @parm Carattere da confrontare
|
|
|
|
{ return s != '\\' && s != '/'; }
|
1994-08-19 07:10:19 +00:00
|
|
|
|
2002-09-13 14:56:23 +00:00
|
|
|
const char* esc(const char* str); // Trasforma le sequenze "\n" nel carattere '\n'
|
|
|
|
const char* unesc(const char* str); // Trasforma i caratteri '\n' nella sequenza "\n"
|
1994-08-19 07:10:19 +00:00
|
|
|
|
|
|
|
#define ODD(x) (x & 1)
|
|
|
|
#define EVEN(x) !(x & 1)
|
|
|
|
|
1995-03-16 09:14:55 +00:00
|
|
|
#endif /* __UTILITY_H */
|