1ac3d0c65SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3ac3d0c65SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4ac3d0c65SAndrew Rist * or more contributor license agreements. See the NOTICE file 5ac3d0c65SAndrew Rist * distributed with this work for additional information 6ac3d0c65SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7ac3d0c65SAndrew Rist * to you under the Apache License, Version 2.0 (the 8ac3d0c65SAndrew Rist * "License"); you may not use this file except in compliance 9ac3d0c65SAndrew Rist * with the License. You may obtain a copy of the License at 10ac3d0c65SAndrew Rist * 11ac3d0c65SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12ac3d0c65SAndrew Rist * 13ac3d0c65SAndrew Rist * Unless required by applicable law or agreed to in writing, 14ac3d0c65SAndrew Rist * software distributed under the License is distributed on an 15ac3d0c65SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16ac3d0c65SAndrew Rist * KIND, either express or implied. See the License for the 17ac3d0c65SAndrew Rist * specific language governing permissions and limitations 18ac3d0c65SAndrew Rist * under the License. 19ac3d0c65SAndrew Rist * 20ac3d0c65SAndrew Rist *************************************************************/ 21ac3d0c65SAndrew Rist 22ac3d0c65SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef CSV_DATETIME_HXX 25cdf0e10cSrcweir #define CSV_DATETIME_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir 28cdf0e10cSrcweir 29cdf0e10cSrcweir namespace csv 30cdf0e10cSrcweir { 31cdf0e10cSrcweir 32cdf0e10cSrcweir 33cdf0e10cSrcweir class Date 34cdf0e10cSrcweir { 35cdf0e10cSrcweir public: 36cdf0e10cSrcweir Date(); 37cdf0e10cSrcweir Date( 38cdf0e10cSrcweir unsigned i_nDay, 39cdf0e10cSrcweir unsigned i_nMonth, 40cdf0e10cSrcweir unsigned i_nYear ); 41cdf0e10cSrcweir Day() const42cdf0e10cSrcweir unsigned Day() const { return nData >> 24; } Month() const43cdf0e10cSrcweir unsigned Month() const { return (nData & 0x00FF0000) >> 16; } Year() const44cdf0e10cSrcweir unsigned Year() const { return nData & 0x0000FFFF; } 45cdf0e10cSrcweir 46cdf0e10cSrcweir static const Date & Null_(); 47cdf0e10cSrcweir 48cdf0e10cSrcweir private: 49cdf0e10cSrcweir UINT32 nData; 50cdf0e10cSrcweir }; 51cdf0e10cSrcweir 52cdf0e10cSrcweir class Time 53cdf0e10cSrcweir { 54cdf0e10cSrcweir public: 55cdf0e10cSrcweir Time(); 56cdf0e10cSrcweir Time( 57cdf0e10cSrcweir unsigned i_nHour, 58cdf0e10cSrcweir unsigned i_nMinutes, 59cdf0e10cSrcweir unsigned i_nSeconds = 0, 60cdf0e10cSrcweir unsigned i_nSeconds100 = 0 ); 61cdf0e10cSrcweir Hour() const62cdf0e10cSrcweir unsigned Hour() const { return nData >> 24; } Minutes() const63cdf0e10cSrcweir unsigned Minutes() const { return (nData & 0x00FF0000) >> 16; } Seconds() const64cdf0e10cSrcweir unsigned Seconds() const { return (nData & 0x0000FF00) >> 8; } Seconds100() const65cdf0e10cSrcweir unsigned Seconds100() const { return nData & 0x000000FF; } 66cdf0e10cSrcweir 67cdf0e10cSrcweir static const Time & Null_(); 68cdf0e10cSrcweir 69cdf0e10cSrcweir private: 70cdf0e10cSrcweir UINT32 nData; 71cdf0e10cSrcweir }; 72cdf0e10cSrcweir 73cdf0e10cSrcweir 74cdf0e10cSrcweir } // namespace csv 75cdf0e10cSrcweir 76cdf0e10cSrcweir 77cdf0e10cSrcweir 78cdf0e10cSrcweir 79cdf0e10cSrcweir #endif 80cdf0e10cSrcweir 81