1994-08-19 07:10:19 +00:00
|
|
|
#ifndef __UTILITY_H
|
|
|
|
#define __UTILITY_H
|
|
|
|
|
2004-11-30 22:02:59 +00:00
|
|
|
#ifndef __STRINGS_H
|
|
|
|
#include <strings.h>
|
1994-08-19 07:10:19 +00:00
|
|
|
#endif
|
|
|
|
|
2004-06-07 12:50:06 +00:00
|
|
|
#ifndef __INCSTR_H
|
|
|
|
#include <../xvaga/incstr.h>
|
|
|
|
#endif
|
|
|
|
|
2004-06-29 11:19:05 +00:00
|
|
|
class TPerformance_profiler : public TObject
|
|
|
|
{
|
|
|
|
TString _desc;
|
|
|
|
long _start;
|
|
|
|
bool _trc;
|
|
|
|
|
|
|
|
public:
|
|
|
|
void show() const;
|
|
|
|
|
|
|
|
TPerformance_profiler(const char* desc = "", bool trc = false);
|
|
|
|
~TPerformance_profiler();
|
|
|
|
};
|
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
|
|
|
|
2004-06-07 12:50:06 +00:00
|
|
|
istream& eatwhite (istream& i);
|
|
|
|
|
2006-12-13 16:22:33 +00:00
|
|
|
const TString & get_hostname();
|
|
|
|
bool is_power_station();
|
|
|
|
|
|
|
|
long daytime();
|
|
|
|
|
1994-08-19 07:10:19 +00:00
|
|
|
#define ODD(x) (x & 1)
|
|
|
|
#define EVEN(x) !(x & 1)
|
|
|
|
|
2006-12-13 16:22:33 +00:00
|
|
|
#endif /* __UTILITY_H */
|