X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fcats%2Fbvfs.h;h=ee7be97abd498b417625306afb6eb6d3774a36a2;hb=f5984fe3b5fe567e1609078ed5966f4d0428f0a7;hp=bc6d43656712cfa5a620908b8b980a4ddc4e5027;hpb=ec4f6ce090161253cd9ef8bc11d1872e6b8bdff0;p=bacula%2Fbacula diff --git a/bacula/src/cats/bvfs.h b/bacula/src/cats/bvfs.h index bc6d436567..ee7be97abd 100644 --- a/bacula/src/cats/bvfs.h +++ b/bacula/src/cats/bvfs.h @@ -44,22 +44,24 @@ /* Helper for result handler */ typedef enum { - BVFS_FILE_RECORD = 5, - BVFS_DIR_RECORD = 4, - BVFS_FILE_VERSION = 6 + BVFS_FILE_RECORD = 'F', + BVFS_DIR_RECORD = 'D', + BVFS_FILE_VERSION = 'V' } bvfs_handler_type; typedef enum { - BVFS_Id = 0, - BVFS_Name = 1, - BVFS_JobId = 2, - BVFS_LStat = 3, + BVFS_Type = 0, /* Could be D, F, V */ + BVFS_PathId = 1, + BVFS_FilenameId = 2, - /* Only if File record */ - BVFS_FileId = 4, + BVFS_Name = 3, + BVFS_JobId = 4, + + BVFS_LStat = 5, /* Can be empty for missing directories */ + BVFS_FileId = 6, /* Can be empty for missing directories */ /* Only if File Version record */ - BVFS_Md5 = 1, + BVFS_Md5 = 3, BVFS_VolName = 4, BVFS_VolInchanger = 5 } bvfs_row_index; @@ -106,12 +108,12 @@ public: /* * Returns true if the directory exists */ - bool ch_dir(char *path); + bool ch_dir(const char *path); bool ls_files(); /* Returns true if we have more files to read */ bool ls_dirs(); /* Returns true if we have more dir to read */ void ls_special_dirs(); /* get . and .. */ - void get_all_file_versions(DBId_t pathid, DBId_t fnid, char *client); + void get_all_file_versions(DBId_t pathid, DBId_t fnid, const char *client); void update_cache(); @@ -151,7 +153,10 @@ public: /* for internal use */ int _handle_path(void *, int, char **); -private: +private: + Bvfs(const Bvfs &); /* prohibit pass by value */ + Bvfs & operator = (const Bvfs &); /* prohibit class assignment */ + JCR *jcr; B_DB *db; POOLMEM *jobids; @@ -173,6 +178,9 @@ private: void *user_data; }; +#define bvfs_is_dir(row) ((row)[BVFS_Type][0] == BVFS_DIR_RECORD) +#define bvfs_is_file(row) ((row)[BVFS_Type][0] == BVFS_FILE_RECORD) + void bvfs_update_path_hierarchy_cache(JCR *jcr, B_DB *mdb, char *jobids); void bvfs_update_cache(JCR *jcr, B_DB *mdb); char *bvfs_parent_dir(char *path);