Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

base.OSVersion.h

00001 /*----------------------------------------------------------------------------
00002   SWORD 2000 - Software With Objects for Rapid Development
00003   Copyright (C) 2003 Eric NICOLAS
00004   ----------------------------------------------------------------------------
00005   SWORD is free software; you can redistribute it and/or modify
00006   it under the terms of the GNU Lesser General Public License as published by
00007   the Free Software Foundation; either version 2 of the License, or
00008   (at your option) any later version.
00009 
00010   SWORD is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013   GNU Lesser General Public License for more details.
00014 
00015   You should have received a copy of the GNU Lesser General Public License
00016   along with SWORD; if not, write to the Free Software
00017   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018   --------------------------------------------------------------------------*/
00019 #ifndef _SWORD_BASE_OSVERSION_
00020 #define _SWORD_BASE_OSVERSION_
00021 
00022 #include "ace/Singleton.h"
00023 
00024 namespace sword {
00025 
00026         class SWORDDECL OsVersion {
00027         public:
00028                 OsVersion();
00029                 ~OsVersion();
00030 
00031                 // families
00032                 enum Family {
00033                         familyUNIX,
00034                         familyWINDOWS
00035                 };
00036 
00037                 // kinds
00038                 enum Kind {
00039                         kindLINUX,
00040                         kindWINDOWS9X,
00041                         kindWINDOWSNT
00042                 };
00043 
00044                 // versions
00045                 enum Version {
00046                         linuxRedhat,
00047                         linuxMandrake,
00048                         windows95,
00049                         windows98,
00050                         windowsMe,
00051                         windowsNT4,
00052                         windows2000,
00053                         windowsXP
00054                 };
00055 
00056                 Family  family()   const;
00057                 Kind    kind()     const;
00058                 Version version()  const;
00059 
00060                 std::string toString() const;
00061                 std::string versionString() const;
00062 
00063         private:
00064                 Family  family_;
00065                 Kind    kind_;
00066                 Version version_;
00067     std::string versionString_;
00068         };
00069         typedef ACE_Singleton<OsVersion, ACE_Thread_Mutex> TheOsVersion;
00070 
00071         class OsVersionException : public Exception {};
00072 
00073 } // namespace sword
00074 
00075 #include "sword.private/base.OSVersion.inl"
00076 
00077 #endif // _SWORD_BASE_OSVERSION_

Generated on Tue Dec 23 20:08:56 2003 for SWORD by doxygen1.3-rc2