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