• Main Page
  • Modules
  • Classes
  • Files
  • File List
  • File Members

FdoTypes.h

Go to the documentation of this file.
00001 #ifndef _FDOTYPES_H_
00002 #define _FDOTYPES_H_
00003 // 
00004 
00005 //
00006 // Copyright (C) 2004-2006  Autodesk, Inc.
00007 // 
00008 // This library is free software; you can redistribute it and/or
00009 // modify it under the terms of version 2.1 of the GNU Lesser
00010 // General Public License as published by the Free Software Foundation.
00011 // 
00012 // This library is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 // Lesser General Public License for more details.
00016 // 
00017 // You should have received a copy of the GNU Lesser General Public
00018 // License along with this library; if not, write to the Free Software
00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 //
00021 
00022 #ifdef _WIN32
00023 #pragma once
00024 #endif
00025 
00026 #ifndef _WIN32
00027 #include <stdint.h>
00028 #else
00029 #include <limits.h>
00030 #endif
00031 
00032 /// \ingroup (typedefs)
00033 /// \brief
00034 /// FdoByte is used to store a single byte of data
00035 typedef unsigned char   FdoByte;
00036 #ifdef _WIN32
00037 /// \ingroup (typedefs)
00038 /// \brief
00039 /// FdoInt8 is used to store a 8 bit signed integer
00040 typedef _int8           FdoInt8;
00041 /// \ingroup (typedefs)
00042 /// \brief
00043 /// FdoInt16 is used to store a 16 bit signed integer
00044 typedef _int16          FdoInt16;
00045 /// \ingroup (typedefs)
00046 /// \brief
00047 /// FdoInt32 is used to store a 32 bit signed integer
00048 typedef _int32          FdoInt32;
00049 /// \ingroup (typedefs)
00050 /// \brief
00051 /// FdoInt64 is used to store a 64 bit signed integer
00052 typedef _int64          FdoInt64;
00053 #else
00054 /// \cond DOXYGEN-IGNORE
00055 typedef int8_t      FdoInt8;
00056 typedef int16_t     FdoInt16;
00057 typedef int32_t     FdoInt32;
00058 typedef int64_t     FdoInt64;
00059 /// \endcond
00060 #endif
00061 /// \ingroup (typedefs)
00062 /// \brief
00063 /// FdoCharacter is used to store a wide character
00064 typedef wchar_t         FdoCharacter;
00065 /// \ingroup (typedefs)
00066 /// \brief
00067 /// FdoString is used to store a constant wide character.
00068 /// Variables declared as FdoString* point to constant wide character strings.
00069 typedef const wchar_t   FdoString;
00070 /// \ingroup (typedefs)
00071 /// \brief
00072 /// FdoBoolean is used to store a boolean (true/false) value
00073 typedef bool            FdoBoolean;
00074 /// \ingroup (typedefs)
00075 /// \brief
00076 /// FdoVoid is used to reference a void (type undetermined)
00077 typedef void            FdoVoid;
00078 /// \ingroup (typedefs)
00079 /// \brief
00080 /// FdoDouble is used to store a double precision floating point number
00081 typedef double          FdoDouble;
00082 /// \ingroup (typedefs)
00083 /// \brief
00084 /// FdoFloat is used to store a single precision floating point number
00085 typedef float           FdoFloat;
00086 
00087 /// \ingroup (typedefs)
00088 /// \brief
00089 /// FdoSize is used to store a size value (e.g. number of elements in an array)
00090 typedef size_t          FdoSize;
00091 
00092 /// \brief
00093 /// FdoDateTime is used to store dates, times, or both.  After constructing 
00094 /// the class you determine which portion has been specified.  The data members
00095 /// are public so they can be accessed directly. No range checking is performed.
00096 /// <ul>
00097 /// <li>Year is in the range of 1 to 9999</li>
00098 /// <li>Month is in the range of 1 to 12 inclusive (January = 1)</li>
00099 /// <li>Day of the month is in the range of 1 to 31 inclusive</li>
00100 /// <li>Hour is since midnight in the range of 0 to 23</li>
00101 /// <li>Minutes are after hour in the range of 0 to 59</li>
00102 /// <li>Seconds are after minute in the range of 0 to 59.9999999</li>
00103 /// </ul>
00104 class FdoDateTime
00105 {
00106 public:
00107     /// \brief
00108     /// Construct a NULL date time value
00109     /// 
00110     /// \return
00111     /// Returns nothing.
00112     /// 
00113     FdoDateTime()
00114     {
00115         year = -1; month = -1; day = -1;
00116         hour = -1; minute = -1; seconds = 0.0f;
00117     }
00118 
00119     /// \brief
00120     /// Construct a date value
00121     /// 
00122     /// \param _year 
00123     /// Input year
00124     /// \param _month 
00125     /// Input month
00126     /// \param _day 
00127     /// Input day of month
00128     /// 
00129     /// \return
00130     /// Returns nothing.
00131     /// 
00132     FdoDateTime(FdoInt16 _year, FdoInt8 _month, FdoInt8 _day)
00133     {
00134         year = _year; month = _month; day = _day;
00135         hour = -1; minute = -1; seconds = 0.0f;
00136     }
00137 
00138     /// \brief
00139     /// Construct a time value
00140     /// 
00141     /// \param _hour 
00142     /// Input hour
00143     /// \param _minutes 
00144     /// Input minutes
00145     /// \param _seconds 
00146     /// Input seconds
00147     /// 
00148     /// \return
00149     /// Returns nothing.
00150     /// 
00151     FdoDateTime(FdoInt8 _hour, FdoInt8 _minutes, float _seconds)
00152     {
00153         year = -1; month = -1; day = -1;
00154         hour = _hour; minute = _minutes; seconds = _seconds;
00155     }
00156 
00157     /// \brief
00158     /// Construct a date time value
00159     /// 
00160     /// \param _year 
00161     /// Input year
00162     /// \param _month 
00163     /// Input month
00164     /// \param _day 
00165     /// Input day of month
00166     /// \param _hour 
00167     /// Input hour
00168     /// \param _minutes 
00169     /// Input minutes
00170     /// \param _seconds 
00171     /// Input seconds
00172     /// 
00173     /// \return
00174     /// Returns nothing.
00175     /// 
00176     FdoDateTime(FdoInt16 _year, FdoInt8 _month, FdoInt8 _day, FdoInt8 _hour, FdoInt8 _minutes, float _seconds)
00177     {
00178         year = _year; month = _month; day = _day;
00179         hour = _hour; minute = _minutes; seconds = _seconds;
00180     }
00181 
00182     /// \brief
00183     /// Returns true if the date is valid
00184     /// 
00185     /// \return
00186     /// Returns true if date has been defined.
00187     /// 
00188     bool IsDate() {return year != -1 && hour == -1;}
00189 
00190     /// \brief
00191     /// Returns true if the time is valid
00192     /// 
00193     /// \return
00194     /// Returns true if time has been defined.
00195     /// 
00196     bool IsTime() {return year == -1 && hour != -1;}
00197 
00198     /// \brief
00199     /// Returns true if both the date and time is valid
00200     /// 
00201     /// \return
00202     /// Returns true if both the date and time has been defined.
00203     /// 
00204     bool IsDateTime() {return year != -1 && hour != -1;}
00205     
00206     FdoInt16    year;
00207     FdoInt8     month;
00208     FdoInt8     day;
00209     FdoInt8     hour;
00210     FdoInt8     minute;
00211     float       seconds;
00212 };
00213 
00214 // Max/Min values
00215 
00216 #ifndef _WIN32
00217 static const FdoInt64 FdoInt64Max = 9223372036854775807LL;
00218 static const FdoInt64 FdoInt64Min = (-9223372036854775807LL - 1LL);
00219 #else
00220 static const FdoInt64 FdoInt64Max = LLONG_MAX;
00221 static const FdoInt64 FdoInt64Min = LLONG_MIN;
00222 #endif
00223 
00224 static const FdoFloat FdoFloatMax = (FdoFloat) 3.4e38;
00225 static const FdoFloat FdoFloatMin = (FdoFloat) -3.4e38;
00226 
00227 #endif // _FDOTYPES_H_
00228 
00229 
Please send us your comment about this page