-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ongoing metadata writer improvements and new command line tool (#2319)
- Loading branch information
Showing
15 changed files
with
435 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,57 @@ | ||
#![allow(dead_code)] | ||
|
||
use std::collections::*; | ||
mod attributes; | ||
mod bindings; | ||
mod flags; | ||
mod imp; | ||
pub mod reader; | ||
pub mod writer; | ||
|
||
pub use attributes::*; | ||
use bindings::*; | ||
pub use flags::*; | ||
use imp::*; | ||
use std::io::*; | ||
use std::mem::*; | ||
use std::ptr::*; | ||
|
||
macro_rules! flags { | ||
($name:ident, $size:ty) => { | ||
#[derive(Default, Copy, Clone, PartialEq, Eq)] | ||
pub struct $name(pub $size); | ||
impl $name { | ||
pub fn contains(&self, contains: Self) -> bool { | ||
*self & contains == contains | ||
} | ||
} | ||
impl std::ops::BitOr for $name { | ||
type Output = Self; | ||
fn bitor(self, other: Self) -> Self { | ||
Self(self.0 | other.0) | ||
} | ||
} | ||
impl std::ops::BitAnd for $name { | ||
type Output = Self; | ||
fn bitand(self, other: Self) -> Self { | ||
Self(self.0 & other.0) | ||
} | ||
} | ||
impl std::ops::BitOrAssign for $name { | ||
fn bitor_assign(&mut self, other: Self) { | ||
self.0.bitor_assign(other.0) | ||
} | ||
} | ||
impl std::ops::BitAndAssign for $name { | ||
fn bitand_assign(&mut self, other: Self) { | ||
self.0.bitand_assign(other.0) | ||
} | ||
} | ||
impl std::ops::Not for $name { | ||
type Output = Self; | ||
fn not(self) -> Self { | ||
Self(self.0.not()) | ||
} | ||
} | ||
}; | ||
} | ||
|
||
pub(crate) use flags; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.