Struct thinlinelib::analysis::Analysis
source · pub struct Analysis<T>where
T: LanguageType,{
pub file_types: &'static [&'static str],
pub project_files: RefCell<Vec<ProjectFile<T>>>,
}
Fields§
§file_types: &'static [&'static str]
§project_files: RefCell<Vec<ProjectFile<T>>>
Implementations§
source§impl<T> Analysis<T>where
T: LanguageType,
impl<T> Analysis<T>where
T: LanguageType,
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new Analysis instance.
Example
use thinlinelib::analysis::Analysis;
use thinlinelib::language_type::{C, LanguageType};
let analysis: Analysis<C> = Analysis::new();
assert_eq!(analysis.file_types, C::file_types());
assert_eq!(analysis.project_files().len(), 0);
sourcepub fn project_files(&self) -> Ref<'_, Vec<ProjectFile<T>>>
pub fn project_files(&self) -> Ref<'_, Vec<ProjectFile<T>>>
Returns a reference to the collected project files for analysis.
sourcepub fn project_files_mut(&self) -> RefMut<'_, Vec<ProjectFile<T>>>
pub fn project_files_mut(&self) -> RefMut<'_, Vec<ProjectFile<T>>>
Returns a mutable reference to the collected project files for analysis.
Example
use thinlinelib::analysis::{Analysis, ProjectFile};
use thinlinelib::language_type::C;
let analysis: Analysis<C> = Analysis::new();
let mut project_files = analysis.project_files_mut();
assert_eq!(project_files.len(), 0);
project_files.push(ProjectFile::new("test/anotherFile"));
assert_eq!(project_files.len(), 1);
sourcepub fn collect_sources(
&self,
project_dir: &PathBuf,
search_dirs: &[String]
) -> Fallible<()>
pub fn collect_sources(
&self,
project_dir: &PathBuf,
search_dirs: &[String]
) -> Fallible<()>
Collects all the sources within the given project dir.
sourcepub fn extract_entities(&self) -> Fallible<()>
pub fn extract_entities(&self) -> Fallible<()>
Extracts function signatures and comments of thinlines parsed files.