ARB
Classes | Macros | Enumerations | Functions | Variables
AW_file.cxx File Reference
#include "aw_file.hxx"
#include "aw_awar.hxx"
#include "aw_root.hxx"
#include "aw_select.hxx"
#include "aw_msg.hxx"
#include "aw_question.hxx"
#include <arbdbt.h>
#include <arb_file.h>
#include <arb_strbuf.h>
#include <arb_misc.h>
#include <arb_str.h>
#include <arb_strarray.h>
#include <sys/stat.h>
#include <dirent.h>
#include <set>
#include <string>
Include dependency graph for AW_file.cxx:

Go to the source code of this file.

Classes

class  LimitedTime
 
class  File_selection
 
class  DuplicateLinkFilter
 
struct  selbox_autorefresh_info
 

Macros

#define SELBOX_AUTOREFRESH_FREQUENCY   3000
 

Enumerations

enum  DirSortOrder { SORT_ALPHA, SORT_DATE, SORT_SIZE, DIR_SORT_ORDERS }
 

Functions

static GB_CSTR expand_symbolic_directories (const char *pwd_envar)
 
charAW_unfold_path (const char *pwd_envar, const char *path)
 
charAW_extract_directory (const char *path)
 
void AW_create_fileselection_awars (AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
 
static GB_CSTR get_suffix (GB_CSTR fullpath)
 
static charset_suffix (const char *name, const char *suffix)
 
const charvalid_path (const char *path)
 
bool AW_is_dir (const char *path)
 
bool AW_is_file (const char *path)
 
bool AW_is_link (const char *path)
 
int entryType (const char *entry)
 
static void show_soft_link (AW_selection_list *filelist, const char *envar, DuplicateLinkFilter &unDup)
 
bool fileOrLink (const char *d)
 
const chargotounit (const char *d)
 
static int cmpBySize (const char *disp1, const char *disp2)
 
bool contains_wildcards (const char *name)
 
static const chardetectBrowserCommand (const char *fname)
 
static void fill_fileselection_cb (AW_root *, File_selection *cbs)
 
static void fileselection_filename_changed_cb (AW_root *, File_selection *cbs)
 
static void fileselection_filter_changed_cb (AW_root *, File_selection *cbs)
 
static unsigned autorefresh_selboxes (AW_root *)
 
static void selbox_install_autorefresh (AW_root *aw_root, File_selection *acbs)
 
void AW_create_fileselection (AW_window *aws, const char *awar_prefix, const char *at_prefix, const char *pwd, DirDisplay disp_dirs, bool allow_wildcards)
 
charAW_get_selected_fullname (AW_root *awr, const char *awar_prefix)
 
void AW_set_selected_fullname (AW_root *awr, const char *awar_prefix, const char *to_fullname)
 
void AW_refresh_fileselection (AW_root *awr, const char *awar_prefix)
 

Variables

static bool avoid_multi_refresh = false
 
static selbox_autorefresh_infoautorefresh_info = NULp
 

Macro Definition Documentation

#define SELBOX_AUTOREFRESH_FREQUENCY   3000

Definition at line 830 of file AW_file.cxx.

Referenced by autorefresh_selboxes(), and selbox_install_autorefresh().

Enumeration Type Documentation

Enumerator
SORT_ALPHA 
SORT_DATE 
SORT_SIZE 
DIR_SORT_ORDERS 

Definition at line 112 of file AW_file.cxx.

Function Documentation

static GB_CSTR expand_symbolic_directories ( const char pwd_envar)
static

Definition at line 37 of file AW_file.cxx.

References GB_getcwd(), and NULp.

Referenced by AW_unfold_path(), and show_soft_link().

char* AW_unfold_path ( const char pwd_envar,
const char path 
)
char* AW_extract_directory ( const char path)

Definition at line 59 of file AW_file.cxx.

References NULp, and result.

Referenced by check_argument_for_mode(), and read_import_format().

void AW_create_fileselection_awars ( AW_root awr,
const char awar_base,
const char directories,
const char filter,
const char file_name 
)
static GB_CSTR get_suffix ( GB_CSTR  fullpath)
static

Definition at line 247 of file AW_file.cxx.

References dot(), and NULp.

Referenced by File_selection::filename_changed().

static char* set_suffix ( const char name,
const char suffix 
)
static
const char* valid_path ( const char path)
inline

Definition at line 295 of file AW_file.cxx.

Referenced by AW_is_dir(), AW_is_file(), and AW_is_link().

bool AW_is_dir ( const char path)
inline

Definition at line 297 of file AW_file.cxx.

References GB_is_directory(), and valid_path().

Referenced by File_selection::filename_changed(), and File_selection::fill().

bool AW_is_file ( const char path)
inline

Definition at line 298 of file AW_file.cxx.

References GB_is_regularfile(), and valid_path().

bool AW_is_link ( const char path)
inline

Definition at line 299 of file AW_file.cxx.

References GB_is_link(), and valid_path().

int entryType ( const char entry)
inline

Definition at line 322 of file AW_file.cxx.

static void show_soft_link ( AW_selection_list filelist,
const char envar,
DuplicateLinkFilter unDup 
)
static
bool fileOrLink ( const char d)
inline

Definition at line 470 of file AW_file.cxx.

Referenced by cmpBySize().

const char* gotounit ( const char d)
inline

Definition at line 471 of file AW_file.cxx.

Referenced by cmpBySize().

static int cmpBySize ( const char disp1,
const char disp2 
)
static

Definition at line 478 of file AW_file.cxx.

References ARB_stricmp(), fileOrLink(), and gotounit().

Referenced by File_selection::fill().

bool contains_wildcards ( const char name)
inline

Definition at line 496 of file AW_file.cxx.

References NULp.

Referenced by File_selection::fill().

static const char* detectBrowserCommand ( const char fname)
static

Definition at line 648 of file AW_file.cxx.

References ARB_strchrnul(), aw_assert, and NULp.

Referenced by File_selection::filename_changed().

static void fill_fileselection_cb ( AW_root ,
File_selection cbs 
)
static

Definition at line 797 of file AW_file.cxx.

References File_selection::fill().

Referenced by AW_create_fileselection().

static void fileselection_filename_changed_cb ( AW_root ,
File_selection cbs 
)
static

Definition at line 803 of file AW_file.cxx.

References File_selection::filename_changed(), and File_selection::fill().

Referenced by AW_create_fileselection().

static void fileselection_filter_changed_cb ( AW_root ,
File_selection cbs 
)
static

Definition at line 813 of file AW_file.cxx.

References File_selection::filename_changed(), and File_selection::fill().

static unsigned autorefresh_selboxes ( AW_root )
static
static void selbox_install_autorefresh ( AW_root aw_root,
File_selection acbs 
)
static
void AW_create_fileselection ( AW_window aws,
const char awar_prefix,
const char at_prefix,
const char pwd,
DirDisplay  disp_dirs,
bool  allow_wildcards 
)

Create a file selection box, this box needs 3 AWARS:

  1. "$awar_prefix/filter"
  2. "$awar_prefix/directory"
  3. "$awar_prefix/file_name"

(Note: The function AW_create_fileselection_awars() can be used to create them)

the "$awar_prefix/file_name" contains the full filename Use AW_get_selected_fullname() to read it.

The items are placed at

  1. "$at_prefix""filter"
  2. "$at_prefix""box"
  3. "$at_prefix""file_name"

if disp_dirs == ANY_DIR, then show directories and files if disp_dirs == MULTI_DIRS, then only show files, but from multiple directories

pwd is the name of a 'shell environment variable' which indicates the base directory (e.g. 'PWD' or 'ARBHOME')

Definition at line 870 of file AW_file.cxx.

References File_selection::create_gui_elements(), fileselection_filename_changed_cb(), fill_fileselection_cb(), AW_window::get_root(), NULp, and selbox_install_autorefresh().

Referenced by AW_create_standard_fileselection(), AWTI_open_import_window(), create_AWTC_export_window(), create_load_box_for_selection_lists(), popup_macro_window(), and popup_ruleset_admin_window().

char* AW_get_selected_fullname ( AW_root awr,
const char awar_prefix 
)
void AW_set_selected_fullname ( AW_root awr,
const char awar_prefix,
const char to_fullname 
)
void AW_refresh_fileselection ( AW_root awr,
const char awar_prefix 
)

Variable Documentation

bool avoid_multi_refresh = false
static

Definition at line 795 of file AW_file.cxx.

selbox_autorefresh_info* autorefresh_info = NULp
static

Definition at line 837 of file AW_file.cxx.

Referenced by autorefresh_selboxes(), and selbox_install_autorefresh().