⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lsutil.h

📁 日志模块代码
💻 H
字号:
/*********************************************************************
* 版权所有 (C)2006, 深圳市中兴通讯股份有限公司。
* 
* 文件名称: LSUtil.h
* 文件标识: 
* 内容摘要: 系统日志服务工具函数定义
* 其它说明: 
* 当前版本: V1.00
* 作    者: 张 帆
* 完成日期: 2006-06-22
* 
* 修改记录1:// 修改历史记录,包括修改日期、修改者及修改内容
*    修改日期:
*    版 本 号:
*    修 改 人:
*    修改内容: 
* 修改记录2:…
**********************************************************************/
#ifndef LSUTIL_H
#define LSUTIL_H

#include <string>
#include <vector>
#include <map>

#ifndef LMSSERVER
    #include "ILogger.h"
#else
    #include "LSComm.h"
#endif

/**************************************************************************
*                            常量                                        *
**************************************************************************/
const int INVALID_LINENUM = -1; 	// 标识无效的文件行数

/**************************************************************************
*                            类CLSUtil声明                                *
**************************************************************************/
class CLSUtil
{
public:
    static std::string GetDefaultPath(void);
    static const std::string FullPath(const std::string& strPartialPath);
    static int make_sure_path_exists(const char *iPath, 
                                     bool FilenameIncluded = false);
    static bool IsAllowedFileName(const std::string& strSrc);
    static int GetFileLineNumber(const std::string& strFile);
    
    static bool MoveFileabc(const std::string& strFileSrc, 
                         const std::string& strFileDest);

    static bool IsFileExists(const std::string& strFile);
    static bool MakeSureFileExists(const std::string& strFile);
    static bool IsNoCaseStrEqual(const std::string& s1, 
                                 const std::string& s2);
    static bool IsNoCaseCharEqual(char c1, char c2);
    static bool IsExist(const std::vector<std::string>& vstrSrc, 
                        const std::string& strChk);
    static const std::string GetLevelString(const NOP::TLogLevel& Level);
    static bool IsAllowedLogLevel(const std::string& strSrc, 
                                  NOP::TLogLevel& Level);
private:
    static void InitLogLevel(void);

    // 日志级别映射表
    static std::map<std::string, NOP::TLogLevel> m_LogLevelMap;    
};

#endif // LSUTIL_H

⌨️ 快捷键说明

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