- Timestamp:
- 01/05/09 17:52:49 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9207 r9208 32 32 * star.cc: 33 33 - removed obsolete -ff option from output 34 35 * mbase/MTime.[h,cc]: 36 - added GetBinary 37 - added WriteBinary 38 -
trunk/MagicSoft/Mars/mbase/MTime.cc
r9156 r9208 886 886 } 887 887 888 // -------------------------------------------------------------------------- 889 // 890 // Calls Set(t[0], t[1], t[2], t[3], t[4], t[5], 0) 891 // 888 892 Bool_t MTime::SetBinary(const UInt_t t[6]) 889 893 { … … 891 895 } 892 896 897 // -------------------------------------------------------------------------- 898 // 899 // Assign: 900 // t[0] = year; 901 // t[1] = month; 902 // t[2] = day; 903 // t[3] = hour; 904 // t[4] = minute; 905 // t[5] = second; 906 // 907 void MTime::GetBinary(UInt_t t[6]) const 908 { 909 UShort_t yea, ms; 910 Byte_t mon, day, h, m, s; 911 912 GetDate(yea, mon, day); 913 GetTime(h, m, s, ms); 914 915 t[0] = yea; 916 t[1] = mon; 917 t[2] = day; 918 t[3] = h; 919 t[4] = m; 920 t[5] = s; 921 } 922 923 // -------------------------------------------------------------------------- 924 // 925 // Read seven bytes representing y, m, d, h, m, s 926 // 893 927 istream &MTime::ReadBinary(istream &fin) 894 928 { … … 908 942 } 909 943 944 // -------------------------------------------------------------------------- 945 // 946 // Write seven bytes representing y, m, d, h, m, s 947 // 948 ostream &MTime::WriteBinary(ostream &out) const 949 { 950 UShort_t y, ms; 951 Byte_t mon, d, h, m, s; 952 953 GetDate(y, mon, d); 954 GetTime(h, m, s, ms); 955 956 out.read((char*)&y, 2); 957 out.read((char*)&mon, 1); 958 out.read((char*)&d, 1); 959 out.read((char*)&h, 1); 960 out.read((char*)&m, 1); 961 out.read((char*)&s, 1); // Total=7 962 } 963 910 964 void MTime::AddMilliSeconds(UInt_t ms) 911 965 { -
trunk/MagicSoft/Mars/mbase/MTime.h
r9156 r9208 118 118 TString GetSqlTimeStamp() const; 119 119 TString GetFileName() const; 120 void GetBinary(UInt_t t[6]) const; 120 121 void GetDate(UShort_t &y, Byte_t &m, Byte_t &d) const; 121 122 MTime GetDateOfSunrise() const; … … 154 155 // I/O functions 155 156 istream &ReadBinary(istream &fin); 157 ostream &WriteBinary(ostream &out) const; 156 158 157 159 void AsciiRead(istream &fin);
Note:
See TracChangeset
for help on using the changeset viewer.