//----------------------------------------------------------------------------
// 程序名称:
// 程序说明:
// 程序作者:
// 程序版本:
// 开始日期:
//----------------------------------------------------------------------------
#ifndef __CONFIGFILE_H__
#define __CONFIGFILE_H__
#include <fstream>;
#include <iostream>;
using namespace std;
#define MAX_LINE_LENGTH 300
//----------------------------------------------------------------------------
// 类说明:用于对配置文件进行操作,对于给定的节名和变量名,获得变量的值。
//----------------------------------------------------------------------------
class CConfigFile
{
//构造函数和析构函数
private:
protected:
public:
//属性
private:
protected:
public:
//服务
private:
protected:
public:
};
#endif //__CONFIGFILE_H__
cpp文件
#include "ConfigFile.h"
#include <string.h>;
//----------------------------------------------------------------------------
// 函数原型: CConfigFile::CConfigFile()
// 函数功能: CConfigFile 构造函数
// 传入参数: 无
// 传出参数: 无
// 函数返回: 无
// 注意事项: 无
//----------------------------------------------------------------------------
CConfigFile::CConfigFile()
{
}
//----------------------------------------------------------------------------
// 函数原型: CConfigFile::CConfigFile(char *pConfigFileName)
// 函数功能: CConfigFile 构造函数
// 传入参数: char *pConfigFileName
// 传出参数: 无
// 函数返回: 无
// 注意事项: 无
//----------------------------------------------------------------------------
CConfigFile::CConfigFile(char *pConfigFileName)
{
}
//----------------------------------------------------------------------------
// 函数原型: CConfigFile::~CConfigFile()
// 函数功能: CConfigFile 析构函数
// 传入参数: 无
// 传出参数: 无
// 函数返回: 无
// 注意事项: 无
//----------------------------------------------------------------------------
CConfigFile::~CConfigFile()
{
}
//----------------------------------------------------------------------------
// 函数原型: short
// 函数功能: 打开指定的配置文件
// 传入参数: char *ConfigFileName
// 传出参数: 无
// 函数返回: 0
//
// 注意事项: 无
//----------------------------------------------------------------------------
short
{
}
//----------------------------------------------------------------------------
// 函数原型: void CConfigFile::Close()
// 函数功能: 关闭配置文件
// 传入参数: 无
// 传出参数: 无
// 函数返回: 无
// 注意事项: 无
//----------------------------------------------------------------------------
void CConfigFile::Close()
{
}
//----------------------------------------------------------------------------
// 函数原型: short
// 函数功能: 从配置文件中读出指定的变量的值
// 传入参数: char *Session
//
//
// 传出参数: 无
// 函数返回: 0
//
// 注意事项: 无
//----------------------------------------------------------------------------
short
{