Patch level : nopatch

Files correlati     :
Commento        :

Aggiunto il metodo between dei interi
Migliorata la input filename
This commit is contained in:
Alessandro Bonazzi 2021-12-13 12:58:48 +01:00
parent f5f4002a8d
commit 362642aeaa
2 changed files with 11 additions and 3 deletions

View File

@ -352,13 +352,19 @@ int list_files(
return count;
}
bool input_filename(TFilename& file)
bool input_filename(TFilename& file, bool existent)
{
DIRECTORY dir; xvt_fsys_get_curr_dir(&dir);
FILE_SPEC fs;
xvt_fsys_convert_str_to_fspec(file, &fs);
const bool good = xvt_dm_post_file_open(&fs, TR("Selezionare il file")) == FL_OK;
bool good;
if (existent)
good = xvt_dm_post_file_open(&fs, TR("Selezionare il file")) == FL_OK;
else
good = xvt_dm_post_file_save(&fs, TR("Indicare il file")) == FL_OK;
xvt_fsys_set_dir(&dir);

View File

@ -77,7 +77,8 @@ bool remove_file(const char* file);
int remove_files(const char* mask, bool subdirs);
int count_files(const char* dir, bool subdirs);
int list_files(const char* mask, TString_array& result);
bool input_filename(TFilename& file);
bool input_filename(TFilename& file, bool existent = true);
const char * get_system_dir(TSystem_dirs what);
const char * standard_path_list();
@ -122,5 +123,6 @@ void split_IBAN(const char * iban, TString & iso, TString & icin,
void set_test_mail(const TString & email);
bool send_mail(TToken_string & to, TToken_string & cc, TToken_string & ccn,
const char * subj, const char * text, TToken_string & attachment, bool ui, bool receipt);
inline bool between(const long val, const long a, const long b) { return ((a == 0 ||val >= a) && (b == 0 || val <= b)); }
#endif /* __UTILITY_H */