Skip to content

Commit

Permalink
feat(xcodeproj): deref as pbxproj
Browse files Browse the repository at this point in the history
  • Loading branch information
kkharji committed Jun 19, 2022
1 parent 8c045ae commit 7cfe8c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xcodeproj"
version = "0.2.4"
version = "0.2.5"
edition = "2021"
description = "xcodeproj reader and parser."
license = "MIT OR Apache-2.0"
Expand Down
34 changes: 3 additions & 31 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
#![doc = include_str!("../README.md")]

use anyhow::Result;
use pbxproj::{PBXFSReference, PBXObjectCollection, PBXProject, PBXRootObject};
use pbxproj::PBXRootObject;
use std::path::{Path, PathBuf};

mod macros;
pub mod pbxproj;
pub mod xcode;

/// Main presentation of XCodeProject
#[derive(Debug, derive_deref_rs::Deref)]
pub struct XCodeProject {
root: PathBuf,
#[deref]
pbxproj: PBXRootObject,
}

Expand All @@ -30,34 +32,4 @@ impl XCodeProject {
pbxproj: pbxproj_path.try_into()?,
})
}

/// Get archive version
pub fn archive_version(&self) -> u8 {
self.pbxproj.archive_version()
}

/// Get pbxproj object version
pub fn object_version(&self) -> u8 {
self.pbxproj.object_version()
}

/// Get root project of pbxproj
pub fn root_project(&self) -> PBXProject {
self.pbxproj.root_project()
}

/// Get root group of pbxproj
pub fn root_group(&self) -> PBXFSReference {
self.pbxproj.root_group()
}

/// Get pbxproj objects
pub fn objects(&self) -> &PBXObjectCollection {
self.pbxproj.objects()
}

/// Get mutable reference of pbxproj objects
pub fn objects_mut(&mut self) -> &mut PBXObjectCollection {
self.pbxproj.objects_mut()
}
}

0 comments on commit 7cfe8c1

Please sign in to comment.