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

📄 cfgmanage.h

📁 用STL模板库实现的配置文件读写库
💻 H
字号:
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice-E is licensed to you under the terms described in the
// ICEE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef CFGMANAGE_H
#define CFGMANAGE_H

#include <IceE/PropertiesF.h>
#include <IceE/Shared.h>
#include <IceE/Mutex.h>
#include <IceE/BuiltinSequences.h>

#include "cfgmanage.h"

namespace ETAH
{
typedef struct
{
	int lineNumber;
	std::string value;
}CfgItem;

class cfgManage : public IceUtil::Mutex, public ::IceUtil::Shared
{
public:
	cfgManage()
	{
	};
	std::string getProperty(const std::string&);
	std::string getPropertyWithDefault(const std::string&, const std::string&);
	Ice::Int getPropertyAsInt(const std::string&);
	Ice::Int getPropertyAsIntWithDefault(const std::string&, Ice::Int);
	void setProperty(const std::string&, const std::string&);
	void load(const std::string&);
	void save(void);
	int getModifyFlag(void);
	int getCheckSum(void);
	int calcChecksum(void);
private:
	std::string fileName;
	std::vector<std::string> fileBuffer;
	void parseLine(const std::string&, int lineNum);
	std::map<std::string, CfgItem> _properties;
	int modifyFlag;
	int chkSum;

	void insertProperty(const std::string&, const std::string&, int);
	void printFileBuffer(void);
};
} //end namespace

#endif

⌨️ 快捷键说明

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