FDO API Reference Feature Data Objects

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 #endif
00029 
00030 /// \brief
00031 /// FdoByte is used to store a single byte of data
00032 typedef unsigned char   FdoByte;
00033 #ifdef _WIN32
00034 /// \brief
00035 /// FdoInt8 is used to store a 8 bit signed integer
00036 typedef _int8           FdoInt8;
00037 /// \brief
00038 /// FdoInt16 is used to store a 16 bit signed integer
00039 typedef _int16          FdoInt16;
00040 /// \brief
00041 /// FdoInt32 is used to store a 32 bit signed integer
00042 typedef _int32          FdoInt32;
00043 /// \brief
00044 /// FdoInt64 is used to store a 64 bit signed integer
00045 typedef _int64          FdoInt64;
00046 #else
00047 /// \cond DOXYGEN-IGNORE
00048 typedef int8_t      FdoInt8;
00049 typedef int16_t     FdoInt16;
00050 typedef int32_t     FdoInt32;
00051 typedef int64_t     FdoInt64;
00052 /// \endcond
00053 #endif
00054 /// \brief
00055 /// FdoCharacter is used to store a wide character
00056 typedef wchar_t         FdoCharacter;
00057 /// \brief
00058 /// FdoString is used to store a constant wide character.
00059 /// Variables declared as FdoString* point to constant wide character strings.
00060 typedef const wchar_t   FdoString;
00061 /// \brief
00062 /// FdoBoolean is used to store a boolean (true/false) value
00063 typedef bool            FdoBoolean;
00064 /// \brief
00065 /// FdoVoid is used to reference a void (type undetermined)
00066 typedef void            FdoVoid;
00067 /// \brief
00068 /// FdoDouble is used to store a double precision floating point number
00069 typedef double          FdoDouble;
00070 /// \brief
00071 /// FdoFloat is used to store a single precision floating point number
00072 typedef float           FdoFloat;
00073 
00074 /// \brief
00075 /// FdoSize is used to store a size value (e.g. number of elements in an array)
00076 typedef size_t          FdoSize;
00077 
00078 /// \brief
00079 /// FdoDateTime is used to store dates, times, or both.  After constructing 
00080 /// the class you determine which portion has been specified.  The data members
00081 /// are public so they can be accessed directly. No range checking is performed.
00082 /// <param name="year">
00083 /// Year in the range of 1 to 9999
00084 /// </param>
00085 /// <param name="month">
00086 /// Month in the range of 1 to 12 inclusive (January = 1)
00087 /// </param>
00088 /// <param name="day">
00089 /// Day of the month in the range of 1 to 31 inclusive
00090 /// </param>
00091 /// <param name="hour">
00092 /// Hour since midnight in the range of 0 to 23
00093 /// </param>
00094 /// <param name="minute">
00095 /// Minutes after hour in the range of 0 to 59
00096 /// </param>
00097 /// <param name="seconds">
00098 /// Seconds after minute in the range of 0 to 59.9999999
00099 /// </param>
00100 class FdoDateTime
00101 {
00102 public:
00103     /// \brief
00104     /// Construct a NULL date time value
00105     /// 
00106     /// \return
00107     /// Returns nothing.
00108     /// 
00109     FdoDateTime()
00110     {
00111         year = -1; month = -1; day = -1;
00112         hour = -1; minute = -1; seconds = 0.0f;
00113     }
00114 
00115     /// \brief
00116     /// Construct a date value
00117     /// 
00118     /// \param _year 
00119     /// Input year
00120     /// \param _month 
00121     /// Input month
00122     /// \param _day 
00123     /// Input day of month
00124     /// 
00125     /// \return
00126     /// Returns nothing.
00127     /// 
00128     FdoDateTime(FdoInt16 _year, FdoInt8 _month, FdoInt8 _day)
00129     {
00130         year = _year; month = _month; day = _day;
00131         hour = -1; minute = -1; seconds = 0.0f;
00132     }
00133 
00134     /// \brief
00135     /// Construct a time value
00136     /// 
00137     /// \param _hour 
00138     /// Input hour
00139     /// \param _minutes 
00140     /// Input minutes
00141     /// \param _seconds 
00142     /// Input seconds
00143     /// 
00144     /// \return
00145     /// Returns nothing.
00146     /// 
00147     FdoDateTime(FdoInt8 _hour, FdoInt8 _minutes, float _seconds)
00148     {
00149         year = -1; month = -1; day = -1;
00150         hour = _hour; minute = _minutes; seconds = _seconds;
00151     }
00152 
00153     /// \brief
00154     /// Construct a date time value
00155     /// 
00156     /// \param _year 
00157     /// Input year
00158     /// \param _month 
00159     /// Input month
00160     /// \param _day 
00161     /// Input day of month
00162     /// \param _hour 
00163     /// Input hour
00164     /// \param _minutes 
00165     /// Input minutes
00166     /// \param _seconds 
00167     /// Input seconds
00168     /// 
00169     /// \return
00170     /// Returns nothing.
00171     /// 
00172     FdoDateTime(FdoInt16 _year, FdoInt8 _month, FdoInt8 _day, FdoInt8 _hour, FdoInt8 _minutes, float _seconds)
00173     {
00174         year = _year; month = _month; day = _day;
00175         hour = _hour; minute = _minutes; seconds = _seconds;
00176     }
00177 
00178     /// \brief
00179     /// Returns true if the date is valid
00180     /// 
00181     /// \return
00182     /// Returns true if date has been defined.
00183     /// 
00184     bool IsDate() {return year != -1 && hour == -1;}
00185 
00186     /// \brief
00187     /// Returns true if the time is valid
00188     /// 
00189     /// \return
00190     /// Returns true if time has been defined.
00191     /// 
00192     bool IsTime() {return year == -1 && hour != -1;}
00193 
00194     /// \brief
00195     /// Returns true if both the date and time is valid
00196     /// 
00197     /// \return
00198     /// Returns true if both the date and time has been defined.
00199     /// 
00200     bool IsDateTime() {return year != -1 && hour != -1;}
00201     
00202     FdoInt16    year;
00203     FdoInt8     month;
00204     FdoInt8     day;
00205     FdoInt8     hour;
00206     FdoInt8     minute;
00207     float       seconds;
00208 };
00209 #endif // _FDOTYPES_H_
00210 
00211 

Comments or suggestions? Send us feedback.