亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? datafile.h

?? Convert Interface on a embedded System
?? H
字號:
#pragma once

//
// CDataFile Class Implementation
//
// The purpose of this class is to provide a simple, full featured means to
// store persistent data to a text file.  It uses a simple key/value paradigm
// to achieve this.  The class can read/write to standard Windows .ini files,
// and yet does not rely on any windows specific calls.  It should work as
// well in a linux environment (with some minor adjustments) as it does in
// a Windows one.
//
// Written July, 2002 by Gary McNickle <gary#sunstorm.net>
// If you use this class in your application, credit would be appreciated.
//

#include <vector>
//#include "fstream.h"
#include <iosfwd>
#include <string>

// Globally defined structures, defines, & types
//////////////////////////////////////////////////////////////////////////////////

// AUTOCREATE_SECTIONS
// When set, this define will cause SetValue() to create a new section, if
// the requested section does not allready exist.
#define AUTOCREATE_SECTIONS     (1L<<1)

// AUOTCREATE_KEYS
// When set, this define causes SetValue() to create a new key, if the
// requested key does not allready exist.
#define AUTOCREATE_KEYS         (1L<<2)

// MAX_BUFFER_LEN
// Used simply as a max size of some internal buffers. Determines the maximum
// length of a line that will be read from or written to the file or the
// report output.
#define MAX_BUFFER_LEN				512


// eDebugLevel
// Used by our Report function to classify levels of reporting and severity
// of report.
enum e_DebugLevel
{
	// detailed programmatic informational messages used as an aid in
	// troubleshooting problems by programmers
	E_DEBUG = 0,
	// brief informative messages to use as an aid in troubleshooting
	// problems by production support and programmers
	E_INFO,
	// messages intended to notify help desk, production support and
	// programmers of possible issues with respect to the running application
	E_WARN,
	// messages that detail a programmatic error, these are typically
	// messages intended for help desk, production support, programmers and
	// occasionally users
	E_ERROR,
	// severe messages that are programmatic violations that will usually
	// result in application failure. These messages are intended for help
	// desk, production support, programmers and possibly users
	E_FATAL,
	// notice that all processing should be stopped immediately after the
	// log is written.
	E_CRITICAL
};


typedef std::string t_Str;

// CommentIndicators
// This constant contains the characters that we check for to determine if a 
// line is a comment or not. Note that the first character in this constant is
// the one used when writing comments to disk (if the comment does not allready
// contain an indicator)
const t_Str CommentIndicators = t_Str(";#");

// EqualIndicators
// This constant contains the characters that we check against to determine if
// a line contains an assignment ( key = value )
// Note that changing these from their defaults ("=:") WILL affect the
// ability of CDataFile to read/write to .ini files.  Also, note that the
// first character in this constant is the one that is used when writing the
// values to the file. (EqualIndicators[0])
const t_Str EqualIndicators   = t_Str("=:"); 

// WhiteSpace
// This constant contains the characters that the Trim() function removes from
// the head and tail of strings.
const t_Str WhiteSpace = t_Str(" \t\n\r");

// st_key
// This structure stores the definition of a key. A key is a named identifier
// that is associated with a value. It may or may not have a comment.  All comments
// must PRECEDE the key on the line in the config file.
typedef struct st_key
{
	t_Str		szKey;
	t_Str		szValue;
	t_Str		szComment;

	st_key()
	{
		szKey = t_Str("");
		szValue = t_Str("");
		szComment = t_Str("");
	}

} t_Key;

typedef std::vector<t_Key> KeyList;
typedef KeyList::iterator KeyItor;

// st_section
// This structure stores the definition of a section. A section contains any number
// of keys (see st_keys), and may or may not have a comment. Like keys, all
// comments must precede the section.
typedef struct st_section
{
	t_Str		szName;
	t_Str		szComment;
	KeyList		Keys;

	st_section()
	{
		szName = t_Str("");
		szComment = t_Str("");
		Keys.clear();
	}

} t_Section;

typedef std::vector<t_Section> SectionList;
typedef SectionList::iterator SectionItor;



/// General Purpose Utility Functions ///////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
void	Report(e_DebugLevel DebugLevel, char *fmt, ...);
t_Str	GetNextWord(t_Str& CommandLine);
int		CompareNoCase(t_Str str1, t_Str str2);
void	Trim(t_Str& szStr);
int		WriteLn(std::fstream& stream, char* fmt, ...);


/// Class Definitions ///////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////


// CDataFile
class CDataFile
{
// Methods
public:
				// Constructors & Destructors
				/////////////////////////////////////////////////////////////////
				CDataFile();
				CDataFile(t_Str szFileName);
	virtual		~CDataFile();

				// File handling methods
				/////////////////////////////////////////////////////////////////
	bool		Load(t_Str szFileName);
	bool		Save();

				// Data handling methods
				/////////////////////////////////////////////////////////////////

				// GetValue: Our default access method. Returns the raw t_Str value
				// Note that this returns keys specific to the given section only.
	t_Str		GetValue(t_Str szKey, t_Str szSection = t_Str("")); 
				// GetString: Returns the value as a t_Str
	t_Str		GetString(t_Str szKey, t_Str szSection = t_Str("")); 
				// GetFloat: Return the value as a float
	float		GetFloat(t_Str szKey, t_Str szSection = t_Str(""));
				// GetInt: Return the value as an int
	int			GetInt(t_Str szKey, t_Str szSection = t_Str(""));
				// GetBool: Return the value as a bool
	bool		GetBool(t_Str szKey, t_Str szSection = t_Str(""));

				// SetValue: Sets the value of a given key. Will create the
				// key if it is not found and AUTOCREATE_KEYS is active.
	bool		SetValue(t_Str szKey, t_Str szValue, 
						 t_Str szComment = t_Str(""), t_Str szSection = t_Str(""));

				// SetFloat: Sets the value of a given key. Will create the
				// key if it is not found and AUTOCREATE_KEYS is active.
	bool		SetFloat(t_Str szKey, float fValue, 
						 t_Str szComment = t_Str(""), t_Str szSection = t_Str(""));

				// SetInt: Sets the value of a given key. Will create the
				// key if it is not found and AUTOCREATE_KEYS is active.
	bool		SetInt(t_Str szKey, int nValue, 
						 t_Str szComment = t_Str(""), t_Str szSection = t_Str(""));

				// SetBool: Sets the value of a given key. Will create the
				// key if it is not found and AUTOCREATE_KEYS is active.
	bool		SetBool(t_Str szKey, bool bValue, 
						 t_Str szComment = t_Str(""), t_Str szSection = t_Str(""));

				// Sets the comment for a given key.
	bool		SetKeyComment(t_Str szKey, t_Str szComment, t_Str szSection = t_Str(""));

				// Sets the comment for a given section
	bool		SetSectionComment(t_Str szSection, t_Str szComment);

				// DeleteKey: Deletes a given key from a specific section
	bool		DeleteKey(t_Str szKey, t_Str szFromSection = t_Str(""));

				// DeleteSection: Deletes a given section.
	bool		DeleteSection(t_Str szSection);
				
				// Key/Section handling methods
				/////////////////////////////////////////////////////////////////

				// CreateKey: Creates a new key in the requested section. The
	            // Section will be created if it does not exist and the 
				// AUTOCREATE_SECTIONS bit is set.
	bool		CreateKey(t_Str szKey, t_Str szValue, 
		                  t_Str szComment = t_Str(""), t_Str szSection = t_Str(""));
				// CreateSection: Creates the new section if it does not allready
				// exist. Section is created with no keys.
	bool		CreateSection(t_Str szSection, t_Str szComment = t_Str(""));
				// CreateSection: Creates the new section if it does not allready
				// exist, and copies the keys passed into it into the new section.
	bool		CreateSection(t_Str szSection, t_Str szComment, KeyList Keys);

				// Utility Methods
				/////////////////////////////////////////////////////////////////
				// SectionCount: Returns the number of valid sections in the database.
	int			SectionCount();
				// KeyCount: Returns the total number of keys, across all sections.
	int			KeyCount();
				// Clear: Initializes the member variables to their default states
	void		Clear();
				// SetFileName: For use when creating the object by hand
				// initializes the file name so that it can be later saved.
	void		SetFileName(t_Str szFileName);
				// CommentStr
				// Parses a string into a proper comment token/comment.
	t_Str		CommentStr(t_Str szComment);				


protected:
				// Note: I've tried to insulate the end user from the internal
				// data structures as much as possible. This is by design. Doing
				// so has caused some performance issues (multiple calls to a
				// GetSection() function that would otherwise not be necessary,etc).
				// But, I believe that doing so will provide a safer, more stable
				// environment. You'll notice that nothing returns a reference,
				// to modify the data values, you have to call member functions.
				// think carefully before changing this.

				// GetKey: Returns the requested key (if found) from the requested
				// Section. Returns NULL otherwise.
	t_Key*		GetKey(t_Str szKey, t_Str szSection);
				// GetSection: Returns the requested section (if found), NULL otherwise.
	t_Section*	GetSection(t_Str szSection);


// Data
public:
	long		m_Flags;		// Our settings flags.

protected:
	SectionList	m_Sections;		// Our list of sections
	t_Str		m_szFileName;	// The filename to write to
	bool		m_bDirty;		// Tracks whether or not data has changed.
};

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女尤物国产一区| 亚洲已满18点击进入久久| 在线播放日韩导航| 8x福利精品第一导航| 在线观看三级视频欧美| 99re成人在线| 91福利国产成人精品照片| 色狠狠桃花综合| 91黄色免费版| 日韩精品一区二区三区视频播放| 欧美精品一区二区在线观看| 中文字幕在线一区二区三区| 亚洲va天堂va国产va久| 亚洲高清免费在线| 国产激情精品久久久第一区二区| 国产精品一线二线三线精华| 国产成人激情av| 日韩午夜电影在线观看| 亚洲欧美一区二区三区孕妇| 日韩电影在线免费| 99久久99久久精品免费观看| 欧美日本国产视频| 亚洲精品乱码久久久久久| 天堂一区二区在线| jiyouzz国产精品久久| 精品成人在线观看| 日韩黄色一级片| 国产91清纯白嫩初高中在线观看| 色悠悠久久综合| 国产精品久久久久影院老司| 免费成人在线视频观看| 91福利在线播放| 亚洲激情在线播放| 92国产精品观看| 日韩理论在线观看| 欧美午夜寂寞影院| 日韩精品一级中文字幕精品视频免费观看| 波多野结衣一区二区三区| 91成人免费在线视频| 亚洲素人一区二区| 99国产精品久久久久| 日韩美女视频19| 91麻豆精品视频| 亚洲一区免费视频| 欧美在线观看禁18| 亚洲精品成人在线| 91蝌蚪国产九色| 亚洲香肠在线观看| 久久综合九色综合欧美就去吻| 国产在线一区二区| 国产精品高清亚洲| 欧美色图12p| 久久精品国产久精国产| 国产日产欧美精品一区二区三区| 丁香五精品蜜臀久久久久99网站| 亚洲欧洲性图库| 日韩免费观看高清完整版| 成人aa视频在线观看| 丝袜亚洲另类欧美| 亚洲欧美在线aaa| 欧美一级精品在线| 成人久久久精品乱码一区二区三区| 国产女主播在线一区二区| 色综合婷婷久久| 蜜臀av一区二区在线免费观看 | 91精品国产手机| 风间由美一区二区三区在线观看| 亚洲丝袜制服诱惑| 欧美变态口味重另类| 色视频一区二区| 高清不卡一区二区在线| 亚洲国产中文字幕在线视频综合| 国产免费成人在线视频| 777色狠狠一区二区三区| 成人免费的视频| 麻豆精品新av中文字幕| 亚洲综合在线观看视频| 国产欧美一区二区精品性色| 91精品国产免费久久综合| 色狠狠色噜噜噜综合网| 色综合久久中文综合久久97| 94色蜜桃网一区二区三区| 国产激情一区二区三区四区 | 色网站国产精品| 成人污污视频在线观看| av在线一区二区三区| 99久久99久久精品国产片果冻 | 精品久久久久香蕉网| 欧美成人午夜电影| 欧美成人欧美edvon| 欧美一区二区三区小说| 日韩视频一区二区三区在线播放 | 亚洲男同1069视频| 亚洲成人动漫精品| 极品瑜伽女神91| 成人毛片视频在线观看| 欧美午夜电影网| 久久久久久麻豆| 亚洲欧洲av色图| 日韩精品久久久久久| 国产在线乱码一区二区三区| 不卡一区二区在线| 制服.丝袜.亚洲.另类.中文| 精品va天堂亚洲国产| 亚洲欧洲日韩一区二区三区| 亚洲国产欧美在线| 国产精品中文字幕日韩精品| 99精品视频一区二区三区| 欧美一区二区三区视频在线 | 99久久久国产精品| 日韩三区在线观看| 亚洲一区二区三区小说| 国产精品系列在线观看| 欧美成人性福生活免费看| 日本成人在线看| 91精品蜜臀在线一区尤物| 日韩中文字幕不卡| 色先锋资源久久综合| 亚洲乱码日产精品bd| 在线亚洲人成电影网站色www| 亚洲丝袜自拍清纯另类| 不卡一卡二卡三乱码免费网站| 亚洲人快播电影网| 91久久精品一区二区| 综合激情网...| 777久久久精品| 蜜桃精品视频在线| 久久综合狠狠综合久久激情| 一区二区不卡在线视频 午夜欧美不卡在| 91在线视频网址| 亚洲综合精品久久| 日韩精品资源二区在线| 国产不卡视频一区| 中文字幕一区在线观看视频| 国产精选一区二区三区| 亚洲欧洲精品一区二区三区不卡| 在线免费视频一区二区| 国产不卡视频在线播放| 欧美亚洲日本国产| 欧美激情中文字幕一区二区| 欧美日韩国产a| 久久精品国产第一区二区三区| 91精品综合久久久久久| 99久久99久久综合| 午夜精品一区二区三区电影天堂| 国产精品网站在线| 欧美日韩国产精选| www.日韩精品| 国产九色sp调教91| 免费国产亚洲视频| 中文字幕日韩一区二区| 久久久综合精品| 欧美精品在线观看播放| 国产99精品在线观看| 精品亚洲国内自在自线福利| 亚洲午夜一区二区三区| 国产精品动漫网站| 91精品国产手机| 欧美日韩电影在线播放| 色综合久久久久综合体桃花网| 岛国精品在线播放| 成人sese在线| 色综合天天综合| 风流少妇一区二区| 国产成人夜色高潮福利影视| 青青草国产精品亚洲专区无| 亚洲影院理伦片| 亚洲欧美激情插| 亚洲chinese男男1069| 亚洲色图一区二区| 亚洲美女少妇撒尿| 亚洲午夜在线视频| 婷婷中文字幕综合| 国内外成人在线| 成人av小说网| 欧美日韩高清不卡| 久久久91精品国产一区二区精品 | 亚洲女厕所小便bbb| 亚洲已满18点击进入久久| 午夜不卡在线视频| 久久国产精品露脸对白| 久久不见久久见免费视频7 | 中文字幕第一区| 亚洲激情五月婷婷| 免费观看日韩电影| 91视视频在线直接观看在线看网页在线看| 成人av免费观看| 在线不卡中文字幕播放| 欧美三级一区二区| 国产精品国产精品国产专区不蜜 | 日韩一二在线观看| 亚洲精品一线二线三线无人区| 1区2区3区精品视频| 精品中文字幕一区二区| 91免费国产在线| 久久精品无码一区二区三区| 亚洲国产精品久久艾草纯爱| 成人理论电影网| 中文字幕一区二区三区在线播放| 日韩在线观看一区二区|