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

📄 propertyfile.h

📁 cisoca_for_mysql 编码
💻 H
字号:
/* ====================================================================
 * The Ciso Software License, Version 1.0
 *
 * Copyright (c) 2003-2004 The Chinese Infomation security organization.  
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Ciso(Chinese Infomation Security Organization) Software 
 *        (http://www.infosecurity.org.cn/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 */
#if !defined(AFX_PROPERTYFILE_H__E660383D_6C9F_4B3C_B18B_8489B9475A33__INCLUDED_)
#define AFX_PROPERTYFILE_H__E660383D_6C9F_4B3C_B18B_8489B9475A33__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MAX_CONF_LINE 256

class AFX_EXT_CLASS CPropertyFile : public CObject  
{
public:

	//==========对外公开的接口=======//
	//
	// 取某个键的值
	//
	int GetValue(char *key,char *value);
	//
	// 修改某个键的值
	//
	int SetValue(char *key,char *value);
	//
	// 增加一个键值对
	//
	int AddItem(char*key,char*value);
	//
	// 将修改后的内容存盘
	//
	int SaveProperty(char *strFileName);
	//
	// (手动或自动)释放所有申请的内存(构造时可自动运行)
	//
	void FreeAll();
	//
	// 一个命令行的测试程序
	//
	int Test();	

public:

	// 构造与析构函数
	CPropertyFile(char *pszFileName);
	virtual ~CPropertyFile();

private:
	typedef struct ConfItem
	{
		char   *pKey;			// 键
		char   *pValue;			// 值
		struct ConfItem *pNext;	// 指向下一个结点的指针
	} NODE ;
	// 维护链表的头指针
	NODE *pHead;
	void trim(char *buf);
};

#endif // !defined(AFX_PROPERTYFILE_H__E660383D_6C9F_4B3C_B18B_8489B9475A33__INCLUDED_)

⌨️ 快捷键说明

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