• Home
  • Raw
  • Download

Lines Matching refs:YearFlags

39 pub struct YearFlags(pub u8);  struct
41 pub const A: YearFlags = YearFlags(0o15);
42 pub const AG: YearFlags = YearFlags(0o05);
43 pub const B: YearFlags = YearFlags(0o14);
44 pub const BA: YearFlags = YearFlags(0o04);
45 pub const C: YearFlags = YearFlags(0o13);
46 pub const CB: YearFlags = YearFlags(0o03);
47 pub const D: YearFlags = YearFlags(0o12);
48 pub const DC: YearFlags = YearFlags(0o02);
49 pub const E: YearFlags = YearFlags(0o11);
50 pub const ED: YearFlags = YearFlags(0o01);
51 pub const F: YearFlags = YearFlags(0o17);
52 pub const FE: YearFlags = YearFlags(0o07);
53 pub const G: YearFlags = YearFlags(0o16);
54 pub const GF: YearFlags = YearFlags(0o06);
56 static YEAR_TO_FLAGS: [YearFlags; 400] = [
113 impl YearFlags { impl
115 pub fn from_year(year: i32) -> YearFlags { in from_year() argument
117 YearFlags::from_year_mod_400(year) in from_year()
121 pub fn from_year_mod_400(year: i32) -> YearFlags { in from_year_mod_400() argument
127 let YearFlags(flags) = *self; in ndays() localVariable
133 let YearFlags(flags) = *self; in isoweek_delta() localVariable
143 let YearFlags(flags) = *self; in nisoweeks() localVariable
148 impl fmt::Debug for YearFlags { implementation
150 let YearFlags(flags) = *self; in fmt() localVariable
281 pub fn new(ordinal: u32, YearFlags(flags): YearFlags) -> Of { in new()
316 pub fn flags(&self) -> YearFlags { in flags() argument
318 YearFlags((of & 0b1111) as u8) in flags()
322 pub fn with_flags(&self, YearFlags(flags): YearFlags) -> Of { in with_flags()
367 YearFlags((of & 0b1111) as u8) in fmt()
400 pub fn new(month: u32, day: u32, YearFlags(flags): YearFlags) -> Mdf { in new()
452 pub fn flags(&self) -> YearFlags { in flags() argument
454 YearFlags((mdf & 0b1111) as u8) in flags()
458 pub fn with_flags(&self, YearFlags(flags): YearFlags) -> Mdf { in with_flags()
478 YearFlags((mdf & 0b1111) as u8) in fmt()
490 use super::{YearFlags, A, AG, B, BA, C, CB, D, DC, E, ED, F, FE, G, GF};
494 const NONLEAP_FLAGS: [YearFlags; 7] = [A, B, C, D, E, F, G];
495 const LEAP_FLAGS: [YearFlags; 7] = [AG, BA, CB, DC, ED, FE, GF];
496 const FLAGS: [YearFlags; 14] = [A, B, C, D, E, F, G, AG, BA, CB, DC, ED, FE, GF];
500 assert_eq!(YearFlags::from_year(2014).ndays(), 365); in test_year_flags_ndays_from_year()
501 assert_eq!(YearFlags::from_year(2012).ndays(), 366); in test_year_flags_ndays_from_year()
502 assert_eq!(YearFlags::from_year(2000).ndays(), 366); in test_year_flags_ndays_from_year()
503 assert_eq!(YearFlags::from_year(1900).ndays(), 365); in test_year_flags_ndays_from_year()
504 assert_eq!(YearFlags::from_year(1600).ndays(), 366); in test_year_flags_ndays_from_year()
505 assert_eq!(YearFlags::from_year(1).ndays(), 365); in test_year_flags_ndays_from_year()
506 assert_eq!(YearFlags::from_year(0).ndays(), 366); // 1 BCE (proleptic Gregorian) in test_year_flags_ndays_from_year()
507 assert_eq!(YearFlags::from_year(-1).ndays(), 365); // 2 BCE in test_year_flags_ndays_from_year()
508 assert_eq!(YearFlags::from_year(-4).ndays(), 366); // 5 BCE in test_year_flags_ndays_from_year()
509 assert_eq!(YearFlags::from_year(-99).ndays(), 365); // 100 BCE in test_year_flags_ndays_from_year()
510 assert_eq!(YearFlags::from_year(-100).ndays(), 365); // 101 BCE in test_year_flags_ndays_from_year()
511 assert_eq!(YearFlags::from_year(-399).ndays(), 365); // 400 BCE in test_year_flags_ndays_from_year()
512 assert_eq!(YearFlags::from_year(-400).ndays(), 366); // 401 BCE in test_year_flags_ndays_from_year()
535 fn check(expected: bool, flags: YearFlags, ordinal1: u32, ordinal2: u32) { in test_of() argument
566 fn check(expected: bool, flags: YearFlags, month1: u32, day1: u32, month2: u32, day2: u32) { in test_mdf_valid() argument
664 fn check(flags: YearFlags, ordinal: u32) { in test_of_with_fields() argument
731 fn check(flags: YearFlags, month: u32, day: u32) { in test_mdf_with_fields() argument