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

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

?? ini.cpp

?? 空調數據多線程采集
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
	GetString(lpSection, lpKey, sz, 1);
	return *sz == _T('\0') ? cDefault : sz[0];
}

BOOL CIni::WriteChar(LPCTSTR lpSection, LPCTSTR lpKey, TCHAR c) const
{
	TCHAR sz[2] = { c, _T('\0') };
	return WriteString(lpSection, lpKey, sz);
}

/////////////////////////////////////////////////////////////////////////////////
// User-Defined Data Type Access
/////////////////////////////////////////////////////////////////////////////////

// Get a block of raw data from the ini file
DWORD CIni::GetDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPVOID lpBuffer, DWORD dwBufSize, DWORD dwOffset) const
{
	LPTSTR psz = __GetStringDynamic(lpSection, lpKey);
	DWORD dwLen = _tcslen(psz) / 2;
	if (dwLen <= dwOffset)
	{
		delete [] psz;
		return 0;
	}

	// verify psz, must be all in hex format
	for (int i = 0; psz[i] != _T('\0'); i++)
	{
		TCHAR c = psz[i];
		if ((c >= _T('0') && c <= _T('9'))
			|| (c >= _T('a') && c <= _T('f'))
			|| (c >= _T('A') && c <= _T('F')))
		{
			// valid
		}
		else
		{
			delete [] psz;
			return 0;
		}
	}

	DWORD dwProcLen = 0;
	LPBYTE lpb = (LPBYTE)lpBuffer;

	if (lpb != NULL)
	{
		dwProcLen = min(dwLen - dwOffset, dwBufSize);
		LPCTSTR p = &psz[dwOffset * 2];
		for (DWORD i = 0; i < dwProcLen; i++)
		{			
			TCHAR sz[3] = _T("");
			_tcsncpy(sz, p, 2);			
			lpb[i] = BYTE(_tcstoul(sz, NULL, 16));
			p = &p[2];
		}			
	}
	else
	{
		dwProcLen = dwLen - dwOffset;
	}
	delete [] psz;
	return dwProcLen;
}

// Write a block of raw data to the ini file
BOOL CIni::WriteDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPCVOID lpData, DWORD dwDataSize) const
{
	const BYTE* lpb = (const BYTE*)lpData;
	if (lpb == NULL)
		return FALSE;

	LPTSTR psz = new TCHAR[dwDataSize * 2 + 1];
	for (DWORD i = 0, j = 0; i < dwDataSize; i++, j += 2)
		_stprintf(&psz[j], _T("%02X"), lpb[i]);
	const BOOL RES = WriteString(lpSection, lpKey, psz);
	delete [] psz;
	return RES;
}

// Append a block of raw data to a specified key in the ini file
BOOL CIni::AppendDataBlock(LPCTSTR lpSection, LPCTSTR lpKey, LPCVOID lpData, DWORD dwDataSize) const
{
	const BYTE* lpb = (const BYTE*)lpData;
	if (lpb == NULL)
		return FALSE;

	LPTSTR psz = new TCHAR[dwDataSize * 2 + 1];
	for (DWORD i = 0, j = 0; i < dwDataSize; i++, j += 2)
		_stprintf(&psz[j], _T("%02X"), lpb[i]);
	const BOOL RES = AppendString(lpSection, lpKey, psz);
	delete [] psz;
	return RES;
}

// Get a POINT value
POINT CIni::GetPoint(LPCTSTR lpSection, LPCTSTR lpKey, POINT ptDefault) const
{
	POINT pt;
	if (GetDataBlock(lpSection, lpKey, &pt, sizeof(POINT)) != sizeof(POINT))
		pt = ptDefault;
	return pt;
}

// Get a RECT value
RECT CIni::GetRect(LPCTSTR lpSection, LPCTSTR lpKey, RECT rcDefault) const
{
	RECT rc;
	if (GetDataBlock(lpSection, lpKey, &rc, sizeof(RECT)) != sizeof(RECT))
		rc = rcDefault;
	return rc;
}

// Write a POINT to the ini file
BOOL CIni::WritePoint(LPCTSTR lpSection, LPCTSTR lpKey, POINT pt) const
{
	return WriteDataBlock(lpSection, lpKey, &pt, sizeof(POINT));
}

// Write a RECT to the ini file
BOOL CIni::WriteRect(LPCTSTR lpSection, LPCTSTR lpKey, RECT rc) const
{
	return WriteDataBlock(lpSection, lpKey, &rc, sizeof(RECT));
}

/////////////////////////////////////////////////////////////////////////////////
// Sections & Keys Access
/////////////////////////////////////////////////////////////////////////////////

// Retrieve a list of key-lines(key-pairs) of the specified section
DWORD CIni::GetKeyLines(LPCTSTR lpSection, LPTSTR lpBuffer, DWORD dwBufSize) const
{
	if (lpBuffer != NULL)
		*lpBuffer = _T('\0');

	if (lpSection == NULL)
		return 0;	

	if (lpBuffer == NULL)
	{
		// just calculate the required buffer size
		DWORD dwLen = DEF_PROFILE_THRESHOLD;
		LPTSTR psz = new TCHAR[dwLen + 1];
		DWORD dwCopied = ::GetPrivateProfileSection(lpSection, psz, dwLen, m_pszPathName);

		while (dwCopied + 2 >= dwLen)
		{
			dwLen += DEF_PROFILE_THRESHOLD;
			delete [] psz;
			psz = new TCHAR[dwLen + 1];
			dwCopied = ::GetPrivateProfileSection(lpSection, psz, dwLen, m_pszPathName);
		}

		delete [] psz;
		return dwCopied + 2;
	}
	else
	{
		return ::GetPrivateProfileSection(lpSection, lpBuffer, dwBufSize, m_pszPathName);
	}
}

// Retrieve a list of key names of the specified section
DWORD CIni::GetKeyNames(LPCTSTR lpSection, LPTSTR lpBuffer, DWORD dwBufSize) const
{
	if (lpBuffer != NULL)
		*lpBuffer = _T('\0');

	if (lpSection == NULL)
		return 0;	

	STR_LIMIT sl;	
	sl.lpTarget = lpBuffer;
	sl.dwRemain = dwBufSize;
	sl.dwTotalCopied = 0;

	const DWORD LEN = GetKeyLines(lpSection, NULL, 0);
	if (LEN == 0)
		return 0;

	LPTSTR psz = new TCHAR[LEN + 1];
	GetKeyLines(lpSection, psz, LEN);
	ParseDNTString(psz, __KeyPairProc, (LPVOID)(&sl));
	delete [] psz;
	if (lpBuffer != NULL)
		lpBuffer[sl.dwTotalCopied] = _T('\0');
	return sl.dwTotalCopied;
}

// Get all section names from an ini file
DWORD CIni::GetSectionNames(LPTSTR lpBuffer, DWORD dwBufSize) const
{
	if (lpBuffer == NULL)
	{
		// just calculate the required buffer size
		DWORD dwLen = DEF_PROFILE_THRESHOLD;
		LPTSTR psz = new TCHAR[dwLen + 1];
		DWORD dwCopied = ::GetPrivateProfileSectionNames(psz, dwLen, m_pszPathName);
		while (dwCopied + 2 >= dwLen)
		{
			dwLen += DEF_PROFILE_THRESHOLD;
			delete [] psz;
			psz = new TCHAR[dwLen + 1];
			dwCopied = ::GetPrivateProfileSectionNames(psz, dwLen, m_pszPathName);
		}
		
		delete [] psz;
		return dwCopied + 2;
	}
	else
	{
		return ::GetPrivateProfileSectionNames(lpBuffer, dwBufSize, m_pszPathName);
	}
}

#ifdef __AFXWIN_H__
void CIni::GetSectionNames(CStringArray *pArray) const
{
	if (pArray != NULL)
		pArray->RemoveAll();

	const DWORD LEN = GetSectionNames(NULL, 0);
	if (LEN == 0)
		return;

	LPTSTR psz = new TCHAR[LEN + 1];
	GetSectionNames(psz, LEN);
	ParseDNTString(psz, __SubStrAdd, pArray);
	delete [] psz;
}
#endif

#ifdef __AFXWIN_H__
// Retrieve a list of key-lines(key-pairs) of the specified section
void CIni::GetKeyLines(LPCTSTR lpSection, CStringArray *pArray) const
{
	if (pArray != NULL)
		pArray->RemoveAll();

	const DWORD LEN = GetKeyLines(lpSection, NULL, 0);
	if (LEN == 0)
		return;

	LPTSTR psz = new TCHAR[LEN + 1];
	GetKeyLines(lpSection, psz, LEN);
	ParseDNTString(psz, __SubStrAdd, pArray);
	delete [] psz;
}
#endif

#ifdef __AFXWIN_H__
// Retrieve a list of key names of the specified section
void CIni::GetKeyNames(LPCTSTR lpSection, CStringArray *pArray) const
{
	if (pArray == NULL)
		return;

	pArray->RemoveAll();
	const LEN = GetKeyNames(lpSection, NULL, 0);
	LPTSTR psz = new TCHAR[LEN + 1];
	GetKeyNames(lpSection, psz, LEN);
	ParseDNTString(psz, __SubStrAdd, (LPVOID)pArray);
	delete [] psz;
}
#endif

// Remove whole section from the ini file
BOOL CIni::DeleteSection(LPCTSTR lpSection) const
{
	return ::WritePrivateProfileString(lpSection, NULL, _T(""), m_pszPathName);
}

// Remove a key from a section
BOOL CIni::DeleteKey(LPCTSTR lpSection, LPCTSTR lpKey) const
{
	return ::WritePrivateProfileString(lpSection, lpKey, NULL, m_pszPathName);
}

BOOL CIni::IsSectionExist(LPCTSTR lpSection) const
{
	if (lpSection == NULL)
		return FALSE;

	// first get the section name list, then check if lpSection exists
	// in the list.
	const DWORD LEN = GetSectionNames(NULL, 0);
	if (LEN == 0)
		return FALSE;

	LPTSTR psz = new TCHAR[LEN + 1];
	GetSectionNames(psz, LEN);
	BOOL RES = !ParseDNTString(psz, __SubStrCompare, (LPVOID)lpSection);
	delete [] psz;
	return RES;
}

BOOL CIni::IsKeyExist(LPCTSTR lpSection, LPCTSTR lpKey) const
{
	if (lpSection == NULL || lpKey == NULL)
		return FALSE;

	// Test it with the default unique string
	LPTSTR psz = __GetStringDynamic(lpSection, lpKey, DEF_PROFILE_TESTSTRING);
	const BOOL RES = (_tcscmp(psz, DEF_PROFILE_TESTSTRING) != 0);
	delete [] psz;
	return RES;
}

BOOL CIni::CopySection(LPCTSTR lpSrcSection, LPCTSTR lpDestSection, BOOL bFailIfExist) const
{
	if (lpSrcSection == NULL || lpDestSection == NULL)
		return FALSE;

	if (_tcsicmp(lpSrcSection, lpDestSection) == 0)
		return FALSE;

	if (!IsSectionExist(lpSrcSection))
		return FALSE;

	if (bFailIfExist && IsSectionExist(lpDestSection))
		return FALSE;

	DeleteSection(lpDestSection);

	const DWORD SRC_LEN = GetKeyLines(lpSrcSection, NULL, 0);
	LPTSTR psz = new TCHAR[SRC_LEN + 2];
	//memset(psz, 0, sizeof(TCHAR) * (SRC_LEN + 2));
	GetKeyLines(lpSrcSection, psz, SRC_LEN);	
	const BOOL RES = ::WritePrivateProfileSection(lpDestSection, psz, m_pszPathName);
	delete [] psz;

	return RES;
}

BOOL CIni::CopyKey(LPCTSTR lpSrcSection, LPCTSTR lpSrcKey, LPCTSTR lpDestSection, LPCTSTR lpDestKey, BOOL bFailIfExist) const
{
	if (lpSrcSection == NULL || lpSrcKey == NULL || lpDestKey == NULL)
		return FALSE;

	if (_tcsicmp(lpSrcSection, lpDestSection) == 0
		&& _tcsicmp(lpSrcKey, lpDestKey) == 0)
		return FALSE;

	if (!IsKeyExist(lpSrcSection, lpSrcKey))
		return FALSE;

	if (bFailIfExist && IsKeyExist(lpDestSection, lpDestKey))
		return FALSE;
	
	LPTSTR psz = __GetStringDynamic(lpSrcSection, lpSrcKey);
	const BOOL RES = WriteString(lpDestSection, lpDestKey, psz);
	delete [] psz;
	return RES;
}

BOOL CIni::MoveSection(LPCTSTR lpSrcSection, LPCTSTR lpDestSection, BOOL bFailIfExist) const
{
	return CopySection(lpSrcSection, lpDestSection, bFailIfExist)
		&& DeleteSection(lpSrcSection);
}

BOOL CIni::MoveKey(LPCTSTR lpSrcSection, LPCTSTR lpSrcKey, LPCTSTR lpDestSection, LPCTSTR lpDestKey, BOOL bFailIfExist) const
{
	return CopyKey(lpSrcSection, lpSrcKey, lpDestSection, lpDestKey, bFailIfExist)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本特黄久久久高潮| 国产丶欧美丶日本不卡视频| 国产精品一区二区在线播放| 欧美性色综合网| 亚洲精品免费在线播放| 丁香网亚洲国际| 2024国产精品| 成人小视频在线| 国产精品亲子伦对白| 国产成人欧美日韩在线电影| 日韩免费一区二区三区在线播放| 亚洲网友自拍偷拍| 欧美大片拔萝卜| 激情欧美一区二区| 国产精品网站在线播放| 不卡一区在线观看| 无码av中文一区二区三区桃花岛| 欧美一区二区三区的| 国产一区二区按摩在线观看| 国产精品久久夜| 91精品91久久久中77777| 日韩高清不卡在线| 中文字幕 久热精品 视频在线| a4yy欧美一区二区三区| 亚洲成人动漫在线观看| 精品国产一区二区精华| 风间由美一区二区av101| 亚洲午夜在线电影| 国产网红主播福利一区二区| 波多野结衣精品在线| 亚洲成人免费视频| 国产精品卡一卡二| 欧美一区二区在线看| 成人福利视频在线看| 亚洲福利国产精品| 国产精品福利电影一区二区三区四区| 欧美专区日韩专区| 国产不卡在线一区| 久久精品久久精品| 亚洲aⅴ怡春院| 亚洲视频一区二区在线| 亚洲免费av在线| 免费成人在线观看视频| 精品国产123| 日韩精品一区二| 欧美视频三区在线播放| 波多野洁衣一区| 国产91对白在线观看九色| 伦理电影国产精品| 秋霞av亚洲一区二区三| 亚洲伊人色欲综合网| 亚洲免费观看高清在线观看| 欧美国产日韩a欧美在线观看| 久久一区二区三区四区| 欧美大片在线观看一区| 日韩一区二区三区观看| 欧洲精品在线观看| 欧美天堂亚洲电影院在线播放| av资源网一区| 色婷婷综合激情| 91九色02白丝porn| 4438x成人网最大色成网站| 91精品在线一区二区| 日韩免费观看高清完整版在线观看| 欧美天堂亚洲电影院在线播放| 9191精品国产综合久久久久久| 91精品办公室少妇高潮对白| 欧美综合欧美视频| 欧美刺激午夜性久久久久久久| 日韩亚洲欧美成人一区| 久久久噜噜噜久久中文字幕色伊伊| 国产欧美日韩不卡| 亚洲精品中文字幕在线观看| 亚洲国产wwwccc36天堂| 美女网站色91| 99久久夜色精品国产网站| 91福利在线导航| 精品福利二区三区| 亚洲激情网站免费观看| 免费人成精品欧美精品| 成人app下载| 欧美不卡123| 午夜欧美在线一二页| 岛国一区二区在线观看| 欧美一区二区国产| 亚洲免费在线播放| 粉嫩绯色av一区二区在线观看| 91精品国产综合久久精品app| 久久久久国产免费免费| 三级久久三级久久久| 97se亚洲国产综合自在线| 亚洲精品一区二区三区精华液| 一区二区三区在线播放| 亚洲午夜久久久久| 亚洲va欧美va国产va天堂影院| 国产91在线观看| 精品国产免费久久| 九色porny丨国产精品| 欧美人与性动xxxx| 亚洲一级二级三级在线免费观看| 99热国产精品| 国产精品久久久久一区二区三区| 国产成人高清在线| 国产欧美日韩卡一| 99久久99久久免费精品蜜臀| 亚洲国产精品传媒在线观看| 国产成人午夜高潮毛片| 久久色.com| av一区二区不卡| 亚洲欧美aⅴ...| 欧美日韩极品在线观看一区| 亚洲成a人v欧美综合天堂| 欧美网站一区二区| 麻豆精品精品国产自在97香蕉| 欧美电视剧免费观看| 国内偷窥港台综合视频在线播放| 久久一区二区三区国产精品| 国产成人鲁色资源国产91色综| 亚洲国产高清在线观看视频| 99在线热播精品免费| 亚洲高清在线精品| 精品区一区二区| 色婷婷亚洲综合| 国产精品伊人色| 亚洲成人av一区| 精品国产乱码久久久久久图片 | 制服丝袜av成人在线看| 国产一区二区电影| 亚洲二区视频在线| 久久精品在这里| 69久久99精品久久久久婷婷 | 亚洲乱码国产乱码精品精小说 | 亚洲男人的天堂av| 精品国偷自产国产一区| 成人爱爱电影网址| 精品一区二区久久| 亚洲国产aⅴ成人精品无吗| 国产精品久久久久影院亚瑟| 日韩欧美国产精品| 欧美日韩视频第一区| 成人短视频下载| 午夜精品福利在线| 欧美日韩精品久久久| www.日韩大片| 风流少妇一区二区| 国产精品18久久久久久久久久久久 | 麻豆91在线播放| 日韩精品免费视频人成| 亚洲国产日韩av| 亚洲主播在线观看| 一区二区三区日韩欧美| 亚洲男人天堂av| 亚洲欧美在线另类| 中文字幕在线一区二区三区| 欧美极品少妇xxxxⅹ高跟鞋 | 精品久久久久久久久久久久久久久久久 | 国产婷婷一区二区| 久久久久久久久久久久久夜| 欧美tickling网站挠脚心| 欧美日韩情趣电影| 色av一区二区| 欧美精品粉嫩高潮一区二区| 欧美日韩在线观看一区二区| 欧美色图片你懂的| 日韩无一区二区| 久久精品一区蜜桃臀影院| 亚洲欧洲精品天堂一级| 自拍偷拍国产精品| 蜜臀av一级做a爰片久久| 国产美女主播视频一区| 99久久免费精品| 欧美男女性生活在线直播观看| 欧美一区二区精美| 国产精品久久久久久户外露出| 亚洲欧洲成人自拍| 日本网站在线观看一区二区三区 | 亚洲午夜精品一区二区三区他趣| 午夜av区久久| 国产精品99久久不卡二区| 99vv1com这只有精品| 欧美一激情一区二区三区| 欧美激情自拍偷拍| 日韩va亚洲va欧美va久久| 不卡一卡二卡三乱码免费网站| 在线播放/欧美激情| 亚洲日本在线a| 国产精品亚洲专一区二区三区| 欧美高清性hdvideosex| 中文字幕电影一区| 狠狠色狠狠色合久久伊人| 色呦呦网站一区| 亚洲人成精品久久久久久| 国产99久久久国产精品潘金网站| 欧美日韩免费一区二区三区视频| 日本一区二区三区免费乱视频 | 51精品秘密在线观看| 精品国产乱码久久久久久闺蜜 | 久久久久久久免费视频了| 视频一区二区不卡| 欧美色精品在线视频|