pub enum Condition {
DataPattern(String),
ModelMatch(String),
MakeMatch(String),
CountEquals(u32),
CountRange(u32, u32),
FormatEquals(String),
Not(Box<Condition>),
And(Vec<Condition>),
Or(Vec<Condition>),
}
Expand description
Condition types for runtime processor selection ExifTool: Condition expressions in tag tables
Variants§
DataPattern(String)
Data pattern matching: $$valPt =~ /pattern/
ExifTool: Binary signature matching like $$valPt =~ /^0204/
ModelMatch(String)
Camera model matching: $$self{Model} =~ /pattern/
ExifTool: Model-specific table selection like $$self{Model} =~ /\b1DS?$/
MakeMatch(String)
Camera make matching: $$self{Make} =~ /pattern/
ExifTool: Manufacturer detection like $$self{Make} =~ /^Canon/
CountEquals(u32)
Count equality: $count == 368
ExifTool: Data structure size validation
CountRange(u32, u32)
Count range: $count >= min && $count <= max
ExifTool: Flexible count validation for variable structures
FormatEquals(String)
Format equality: $format eq "undef"
ExifTool: Format-based dispatch decisions
Not(Box<Condition>)
Negation: $$valPt!~/pattern/
ExifTool: Negative pattern matching
And(Vec<Condition>)
Logical AND: Multiple conditions must be true ExifTool: Complex conditional expressions
Or(Vec<Condition>)
Logical OR: Any condition must be true ExifTool: Alternative dispatch paths
Implementations§
Source§impl Condition
impl Condition
Sourcepub fn evaluate(&self, context: &EvalContext<'_>) -> bool
pub fn evaluate(&self, context: &EvalContext<'_>) -> bool
Evaluate condition against provided context ExifTool: Runtime condition evaluation in processor dispatch
Sourcepub fn data_pattern(pattern: &str) -> Result<Self>
pub fn data_pattern(pattern: &str) -> Result<Self>
Create a data pattern condition from a regex string
ExifTool: $$valPt =~ /pattern/
expressions
Sourcepub fn model_match(pattern: &str) -> Result<Self>
pub fn model_match(pattern: &str) -> Result<Self>
Create a model matching condition from a regex string
ExifTool: $$self{Model} =~ /pattern/
expressions
Sourcepub fn make_match(pattern: &str) -> Result<Self>
pub fn make_match(pattern: &str) -> Result<Self>
Create a make matching condition from a regex string
ExifTool: $$self{Make} =~ /pattern/
expressions
Source§impl Condition
Common condition constructors for ExifTool patterns
ExifTool: Frequently used condition patterns
impl Condition
Common condition constructors for ExifTool patterns ExifTool: Frequently used condition patterns
Sourcepub fn canon_1d_series() -> Self
pub fn canon_1d_series() -> Self
Canon EOS 1D series detection
ExifTool: $$self{Model} =~ /\b1DS?$/
Sourcepub fn canon_1d_mark_ii() -> Self
pub fn canon_1d_mark_ii() -> Self
Canon EOS 1D Mark II detection
ExifTool: $$self{Model} =~ /\b1Ds? Mark II$/
Sourcepub fn canon_1d_mark_iii() -> Self
pub fn canon_1d_mark_iii() -> Self
Canon EOS 1D Mark III detection
ExifTool: $$self{Model} =~ /\b1Ds? Mark III$/
Sourcepub fn nikon_lens_data_0204() -> Self
pub fn nikon_lens_data_0204() -> Self
Nikon LensData version 0204 detection
ExifTool: $$valPt =~ /^0204/
Sourcepub fn nikon_lens_data_0402() -> Self
pub fn nikon_lens_data_0402() -> Self
Nikon LensData version 0402 detection
ExifTool: $$valPt =~ /^0402/
Sourcepub fn sony_camera_info_counts() -> Self
pub fn sony_camera_info_counts() -> Self
Sony CameraInfo count variants
ExifTool: $count == 368 or $count == 5478
Sourcepub fn canon_make() -> Self
pub fn canon_make() -> Self
Canon manufacturer detection
ExifTool: $$self{Make} =~ /^Canon/
Sourcepub fn sony_or_hasselblad_variant() -> Self
pub fn sony_or_hasselblad_variant() -> Self
Sony manufacturer detection with Hasselblad variants
ExifTool: $$self{Make}=~/^SONY/ or ($$self{Make}=~/^HASSELBLAD/ and $$self{Model}=~/^(HV|Stellar|Lusso|Lunar)/)