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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? textfile.cpp

?? 管理項目進度工具的原代碼
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/* ==========================================================================
	CTextFile

	Author :		Johan Rosengren, Abstrakt Mekanik AB

	Date :			2004-03-22

	Purpose :		The class is a helper-package for text files and 
					windows. It allows loading and saving text files in a 
					single operation, as well as getting text to and 
					from edit- and listboxes. If an empty filename is given 
					as a parameter to a call, the standard file dialog will 
					be displayed, to let the user select a file.
					Error handling is managed internally, and the different 
					API-functions return a BOOL to signal success or 
					failure. In case of failure, FALSE returned, the member 
					function GetErrorMessage can be called to retrieve a 
					CString with the error message.
					If this string is empty, the file selection was aborted 
					in the case of an empty input name.
   ========================================================================
					14/4 2005	Added Dave Pritchards class CStdioFileEx
								for MBCS/UNICODE-support.
   ========================================================================*/

#include "stdafx.h"
#include "TextFile.h"
#include "StdioFileEx.h"

////////////////////////////////////////
// CTextFile construction/destruction

CTextFile::CTextFile( const CString& ext, const CString& eol )
/* ============================================================
	Function :		CTextFile::CTextFile
	Description :	constructor
					
	Return :		void
	Parameters :	const CString& ext	-	Standard extension 
											to use in case no 
											file name is given.
					const CString& eol	-	The end-of-line to 
											use. Defaults to 
											"\r\n".

   ============================================================*/
{

	m_extension = ext;
	m_eol = eol;

}

CTextFile::~CTextFile()
/* ============================================================
	Function :		CTextFile::~CTextFile
	Description :	destructor
					
	Return :		void
	Parameters :	none

   ============================================================*/
{
}

////////////////////////////////////////
// CTextFile operations
//

BOOL CTextFile::ReadTextFile( CString& filename, CStringArray& contents )
/* ============================================================
	Function :		CTextFile::ReadTextFile
	Description :	Will read the contents of the file filename 
					into the CStringArray contents, one line 
					from the file at a time.
					If filename is empty, the standard file 
					dialog will be displayed, and - if OK is 
					selected - filename will contain the 
					selected filename on return.

	Return :		BOOL					-	TRUE if OK. 
												GetErrorMessage 
												will contain errors.
	Parameters :	CString& filename		-	file to read from
					CStringArray& contents	-	will be filled 
												with the contents 
												of the file

   ============================================================*/
{

	ClearError();
	BOOL result = TRUE;

	if( filename.IsEmpty() )
		result = GetFilename( FALSE, filename );

	if( result )
	{
		CStdioFileEx file;
		CFileException feError;

		if( file.Open( filename, CFile::modeRead , &feError ) )
		{

			contents.RemoveAll();

			CString line;
			while( file.ReadString( line ) )
				contents.Add( line );

			file.Close();

		}
		else
		{

			TCHAR	errBuff[256];
			feError.GetErrorMessage( errBuff, 256 );
			m_error = errBuff;
			result = FALSE;

		}
	}

	return result;

}

BOOL CTextFile::ReadTextFile( CString& filename, CString& contents )
/* ============================================================
	Function :		CTextFile::ReadTextFile
	Description :	Will read the contents of the file filename 
					into contents.
					If filename is empty, the standard file 
					dialog will be displayed, and - if OK is 
					selected - filename will contain the 
					selected filename on return.
					
	Return :		BOOL				-	TRUE if OK. 
											GetErrorMessage will 
											contain errors.
	Parameters :	CString& filename	-	file to read from
					CString& contents	-	will be filled with 
											the contents of the 
											file

   ============================================================*/
{

	contents = _T( "" );

	// Error handling
	ClearError();

	CStdioFileEx file;
	CFileException feError;
	BOOL result = TRUE;

	if( filename.IsEmpty() )
		result = GetFilename( FALSE, filename );

	if( result )
	{

		// Reading the file
		if( file.Open( filename, CFile::modeRead | CFile::typeText, &feError ) )
		{

			CString line;
			while( file.ReadString( line ) )
				contents += line + m_eol;

			file.Close();

		}
		else
		{

			// Setting error message
			TCHAR	errBuff[256];
			feError.GetErrorMessage( errBuff, 256 );
			m_error = errBuff;
			result = FALSE;

		}
	}

	return result;

}

BOOL CTextFile::WriteTextFile( CString& filename, const CStringArray& contents )
/* ============================================================
	Function :		CTextFile::WriteTextFile
	Description :	Writes contents to filename. Will create 
					the file if it doesn't already exist, 
					overwrite it otherwise.
					If filename is empty, the standard file 
					dialog will be displayed, and - if OK is 
					selected - filename will contain the 
					selected filename on return.
					
	Return :		BOOL							-	TRUE if OK. 
														GetErrorMessage 
														will return 
														errors
	Parameters :	CString& filename				-	file to 
														write to
					conste CStringArray& contents	-	contents 
														to write

   ============================================================*/
{

	// Error handling
	ClearError();

	CStdioFileEx file;
	CFileException feError;
	BOOL result = TRUE;

	if( filename.IsEmpty() )
		result = GetFilename( TRUE, filename );

	if( result )
	{
		// Write file
		if( file.Open( filename, CFile::modeWrite | CFile::modeCreate , &feError ) )
		{

			int max = contents.GetSize();
			for( int t = 0 ; t < max ; t++ )
				file.WriteString( contents[ t ] + m_eol );

			file.Close();

		}
		else
		{

			// Set error message
			TCHAR	errBuff[256];
			feError.GetErrorMessage( errBuff, 256 );
			m_error = errBuff;
			result = FALSE;

		}
	}

	return result;

}

BOOL CTextFile::WriteTextFile( CString& filename, const CString& contents )
/* ============================================================
	Function :		CTextFile::WriteTextFile
	Description :	Writes contents to filename. Will create 
					the file if it doesn't already exist, 
					overwrite it otherwise.
					If filename is empty, the standard file 
					dialog will be displayed, and - if OK is 
					selected - filename will contain the 
					selected filename on return.
					
	Return :		BOOL					-	TRUE if OK. 
												GetErrorMessage 
												will return 
												errors
	Parameters :	CString& filename		-	file to write to
					const CString& contents	-	contents to write

   ============================================================*/
{

	// Error checking
	ClearError();

	CStdioFileEx file;
	CFileException feError;
	BOOL result = TRUE;

	if( filename.IsEmpty() )
		result = GetFilename( TRUE, filename );

	if( result )
	{
		// Write the file
		if( file.Open( filename, CFile::modeWrite | CFile::modeCreate , &feError ) ) 
		{

			file.WriteString( contents );
			file.Close();

		}
		else
		{

			// Set error message
			TCHAR	errBuff[256];
			feError.GetErrorMessage( errBuff, 256 );
			m_error = errBuff;
			result = FALSE;

		}
	}

	return result;

}

BOOL CTextFile::AppendFile( CString& filename, const CString& contents )
/* ============================================================
	Function :		CTextFile::AppendFile
	Description :	Appends contents to filename. Will create 
					the file if it doesn't already exist.
					If filename is empty, the standard file 
					dialog will be displayed, and - if OK is 
					selected - filename will contain the 
					selected filename on return.
					AppendFile will not add eols.
					
	Return :		BOOL					-	TRUE if OK. 
												GetErrorMessage 
												will return errors
	Parameters :	CString& filename		-	file to write to
					const CString& contents	-	contents to write

   ============================================================*/
{

	CFile file;
	CFileException feError;
	BOOL result = TRUE;

	if( filename.IsEmpty() )
		result = GetFilename( TRUE, filename );

	if( result )
	{
		// Write the file
		if( file.Open( filename, CFile::modeWrite | CFile::modeCreate | CFile::modeNoTruncate, &feError ) ) 
		{

			file.SeekToEnd();
			file.Write( contents, contents.GetLength() );
			file.Close();

		}
		else
		{

			// Set error message
			TCHAR	errBuff[256];
			feError.GetErrorMessage( errBuff, 256 );
			m_error = errBuff;
			result = FALSE;

		}
	}

	return result;

}

BOOL CTextFile::AppendFile( CString& filename, const CStringArray& contents )
/* ============================================================
	Function :		CTextFile::AppendFile
	Description :	Appends contents to filename. Will create 
					the file if it doesn't already exist.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩激情| 不卡影院免费观看| 国产美女一区二区三区| 国产成人99久久亚洲综合精品| 91亚洲午夜精品久久久久久| 欧美日本在线一区| 精品国产乱码久久久久久1区2区| 国产精品久久网站| 午夜视频在线观看一区二区| 国产一区二区三区av电影| 91影院在线观看| 日韩欧美综合一区| 国产精品久久久久永久免费观看 | 久久国产麻豆精品| 99精品国产一区二区三区不卡| 欧美美女bb生活片| 国产日产精品1区| 亚洲高清在线精品| 国产精品影视天天线| 欧美亚州韩日在线看免费版国语版| 国产精品久久久久影院亚瑟 | 成人性色生活片| 欧美日产在线观看| 国产精品久久久久一区二区三区共| 日韩专区一卡二卡| 成人av影院在线| 日韩一区二区免费视频| 亚洲欧美偷拍卡通变态| 精品一区二区影视| 欧美日韩国产影片| 亚洲日本一区二区| 国产精品综合久久| 678五月天丁香亚洲综合网| 国产欧美日产一区| 久久精品国产精品亚洲精品 | 亚洲精品国产精品乱码不99 | 日韩无一区二区| 日韩美女精品在线| 国产真实乱偷精品视频免| 欧美日韩午夜在线| 亚洲日本在线天堂| 成人免费三级在线| 久久久99精品久久| 久久激情综合网| 欧美乱熟臀69xxxxxx| 亚洲美女视频在线| 成人免费看的视频| 久久久久亚洲蜜桃| 视频一区二区欧美| 欧美日韩精品一区二区三区 | 欧美日韩色综合| 亚洲欧美国产毛片在线| 9人人澡人人爽人人精品| 精品国产乱码久久| 久久国产精品99久久人人澡| 欧美日韩免费一区二区三区视频| 一区二区三区四区五区视频在线观看| 成人激情黄色小说| 国产精品九色蝌蚪自拍| 国内外成人在线视频| 精品日韩成人av| 日本亚洲三级在线| 7777精品伊人久久久大香线蕉完整版 | 在线观看日韩精品| 亚洲欧洲制服丝袜| 94-欧美-setu| 亚洲同性gay激情无套| 成人av在线电影| 中文字幕亚洲视频| 一本一道综合狠狠老| 亚洲欧美日韩一区二区 | 国产资源精品在线观看| 精品奇米国产一区二区三区| 捆绑调教美女网站视频一区| 精品国产乱码久久| 国产一区二区导航在线播放| 欧美大胆人体bbbb| 国内精品嫩模私拍在线| 久久久精品国产免费观看同学| 日韩二区三区四区| 欧美成人r级一区二区三区| 日韩写真欧美这视频| 亚洲一区二区视频| 国产精品自产自拍| 91官网在线观看| 国产欧美日韩卡一| 国产美女一区二区三区| 91麻豆精品国产91久久久久久久久| 日本一区二区三区在线不卡| 日本伊人色综合网| 日韩欧美精品三级| 激情综合色综合久久| 国产午夜精品一区二区三区视频| 美女视频黄 久久| 精品国产亚洲在线| 成人综合婷婷国产精品久久免费| 欧美激情中文不卡| 不卡影院免费观看| 一区二区成人在线| 7777精品久久久大香线蕉 | 欧美日韩一级视频| 日本中文字幕一区| 国产亚洲精久久久久久| 99综合电影在线视频| 一区二区三区免费观看| 制服丝袜激情欧洲亚洲| 国产在线乱码一区二区三区| 国产精品欧美久久久久一区二区| 色94色欧美sute亚洲线路一久| 亚洲成人精品一区| 欧美一区二区三区日韩| 成人午夜电影小说| 亚洲午夜一区二区| 日韩视频123| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美亚洲高清一区| 美脚の诱脚舐め脚责91| 亚洲国产精品成人综合| 欧美日韩免费观看一区三区| 久久99精品久久久久| 国产精品免费视频一区| 欧美亚洲免费在线一区| 国产一区二区三区综合| 一区二区三区中文在线| 日韩午夜激情av| 色综合欧美在线视频区| 蜜臀精品久久久久久蜜臀| 中文字幕高清不卡| 91精品在线麻豆| 成人国产在线观看| 日韩精品亚洲专区| 一区在线观看免费| 欧美第一区第二区| 99r精品视频| 精品一区二区三区视频在线观看| 亚洲欧美另类小说| 久久免费午夜影院| 欧美日韩午夜影院| 成人精品视频一区二区三区| 色综合天天综合网天天看片| 青草av.久久免费一区| 中文字幕在线不卡国产视频| 日韩精品一区二区三区四区视频| 一道本成人在线| 国产成人三级在线观看| 亚洲国产精品久久不卡毛片| 国产精品欧美一区二区三区| 日韩欧美一区在线| 欧洲国产伦久久久久久久| 国产精品亚洲综合一区在线观看| 亚洲国产裸拍裸体视频在线观看乱了 | 国产精品色一区二区三区| 日韩欧美美女一区二区三区| 欧美在线视频日韩| k8久久久一区二区三区 | 日韩欧美精品三级| 欧美亚洲一区二区在线观看| 9色porny自拍视频一区二区| 国产精品系列在线播放| 免费在线观看成人| 亚洲.国产.中文慕字在线| 成人欧美一区二区三区黑人麻豆| 91麻豆精品国产91久久久更新时间| 91视频观看视频| 丁香六月综合激情| 国产美女精品人人做人人爽| 蜜桃久久久久久久| 视频一区中文字幕国产| 一区二区三区高清| 中文字幕一区二区三区精华液 | 亚洲天堂福利av| 久久久国产精品不卡| 26uuu精品一区二区| 精品理论电影在线| 91麻豆精品国产91久久久久久久久| 在线观看国产一区二区| 在线亚洲高清视频| 色视频成人在线观看免| 97se亚洲国产综合在线| 91碰在线视频| 99久久精品国产导航| 成人午夜精品一区二区三区| 成人综合婷婷国产精品久久 | 国产精品视频免费| 久久精品视频一区二区三区| 久久久夜色精品亚洲| 国产视频一区在线观看| 久久精品一区二区| 国产精品五月天| 国产农村妇女毛片精品久久麻豆 | 337p粉嫩大胆噜噜噜噜噜91av| 欧美人伦禁忌dvd放荡欲情| 色婷婷精品久久二区二区蜜臀av| 91亚洲国产成人精品一区二三| 91视频观看免费| 色成人在线视频| 欧美久久婷婷综合色| 欧美军同video69gay| 日韩欧美精品三级| 精品国产制服丝袜高跟|