waros.h

来自「ftpserver very good sample」· C头文件 代码 · 共 106 行

H
106
字号
/** */#ifndef WAR_OS_H#define WAR_OS_H/* SYSTEM INCLUDES *//* PROJECT INCLUDES */#ifndef WAR_EXCEPTION#   include "WarException.h"#endif#ifndef WAR_TMP_FILE_NAME_H#   include "WarTmpFileName.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplusclass WarOs {public:    typedef char tmpfile_char_t;    typedef WarPath<tmpfile_char_t> tmpfile_path_t;    typedef const tmpfile_char_t *tmpfile_ccstr_t;    // LIFECYCLE        /**    * Default constructor.    */    WarOs(void) throw(WarException);        /**    * Destructor.    */    ~WarOs(void);        // OPERATORS            // OPERATIONS        tmpfile_path_t GetNewTmpFileName(tmpfile_ccstr_t tmpPath = NULL,         tmpfile_ccstr_t preFix = NULL);    // ACCESS    static WarOs& GetOs() throw(WarException)    {        if (!mspThis)            WarThrow(WarError(WAR_ERR_INTERNAL_DATA_NOT_INITIALIZED), NULL);        return *mspThis;    }    // INQUIRY    bool IsNt() const;        std::string GetOsName() const;   protected:private:#ifdef WIN32    OSVERSIONINFO mOsInfo;#endif    static WarOs *mspThis;    WarTmpFileName<tmpfile_char_t> mTmpName;};/* INLINE METHODS *//* EXTERNAL REFERENCES */#define WarIsNt() (WarOs::GetOs().IsNt())#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif  /* WAR_OS_H_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?