Abstract base class providing common properties and methods for files and folders.
FileBase is the foundation of the file system hierarchy:
- File: Represents individual files
- Folder: Represents directories (can also be projects when is_project = true)
- FileAlias: Represents symlinks/aliases to files or folders
ID Semantics
- id = 0: New file (will be inserted into database)
- id > 0: Existing file (will be updated in database)
- id < 0: Fake file (not in database, skips DB operations)
Fake files are used for accessing files outside the project scope. They skip database operations in saveToDB().
- public string base_type { get; set; }
Base type identifier for serialization and database storage.
- public int cursor_line { get; set; }
Last cursor line number (stored in database, default: 0).
- public int cursor_offset { get; set; }
Last cursor character offset (stored in database, default: 0).
- public int64 delete_id { get; set; }
Reference to FileHistory record where this file was deleted.
- public string display_approval_text { owned get; }
Display text for approval list with visual indicators.
- public string display_approval_tooltip { owned get; }
Tooltip text for approval list with full path and change type.
- public string display_name { get; set; }
Display name for binding in lists.
- public virtual string display_with_indicators { get; }
Display text with status indicators. Base implementation just returns
display_name.
- public virtual string icon_name { get; set; }
Icon name for binding in lists. Returns icon_name if set, otherwise a
default based on type.
- public int64 id { get; set; }
Database ID.
- public bool is_active { get; set; }
Whether this is the currently active/viewed item.
- public bool is_alias { get; }
Whether this is an alias/symlink. Computed property: Returns true if
this is a FileAlias.
- public bool is_ignored { get; set; }
Whether this file is ignored by git (stored in database, default:
false).
- public bool is_need_approval { get; set; }
Whether the file needs approval.
- public bool is_project { get; set; }
Whether this folder represents a project (stored in database, default:
false).
- public int is_repo { get; set; }
Whether this folder is a git repository (stored in database, default:
-1). -1 = not checked, 0 = checked and not a repo, 1 = it is a repo.
- public bool is_text { get; set; }
Whether this file is a text file (stored in database, default: false).
- public bool is_unsaved { get; set; }
Whether the file has unsaved changes.
- public string language { get; set; }
Programming language (optional, for files).
- public string last_change_type { get; set; }
The most recent change type from FileHistory ("added", "modified",
"deleted", or ""). Set when is_need_approval is set to true.
- public int64 last_modified { get; set; }
Unix timestamp of last modification (stored in database, default: 0).
- public int64 last_vector_scan { get; set; }
Unix timestamp of last vector scan (stored in database, default: 0).
For files: timestamp when vector scan completed (after successful vectorization). For folders: timestamp when vector scan started (to
prevent re-recursion during same scan).
- public int64 last_viewed { get; set; }
Unix timestamp of last view (stored in database, default: 0).
- public ProjectManager manager { get; construct; }
Reference to ProjectManager.
- public Folder? parent { get; set; }
Reference to parent folder (nullable for root folders/projects).
- public int64 parent_id { get; set; }
Parent folder ID for database storage.
- public string path { get; set; }
File/folder path.
- public string path_basename { owned get; }
Basename derived from path (for property binding).
- public FileBase? points_to { get; set; }
Reference to the FileBase object this alias points to (nullable, only
set when is_alias = true). This is the actual object reference, loaded from database via points_to_id.
- public int64 points_to_id { get; set; }
The ID of the FileBase object this alias points to (foreign key
reference).
- public int scroll_position { get; set; }
Last scroll position (stored in database, optional, default: 0).
- public string target_path { get; set; }
The path of the FileBase object this alias points to (for database
queries). This is stored in the database to enable efficient path-based lookups.
- public string tooltip { get; set; }
Tooltip text for binding in lists.