/[projet1]/public/pc/tools/oric/Bin2Tap/Source/TapeWriter.cpp
Defence Force logotype

Contents of /public/pc/tools/oric/Bin2Tap/Source/TapeWriter.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 318 - (show annotations)
Wed Apr 28 12:48:04 2010 UTC (10 years, 1 month ago) by Vampire
File size: 902 byte(s)


1 #include "StdAfx.h"
2 #include "TapeWriter.h"
3 #include "mmsystem.h"
4
5 #define MAKEFOURCC(ch0, ch1, ch2, ch3) \
6 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
7 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
8
9 CTapeWriter::CTapeWriter( void)
10 {
11 m_OutputFile = NULL;
12 }
13
14 CTapeWriter::~CTapeWriter(void)
15 {
16 delete m_OutputFile;
17 }
18
19 bool CTapeWriter::Open( LPCTSTR filename)
20 {
21 try
22 {
23 m_OutputFile = new CFile();
24 if ( !m_OutputFile->Open( filename, CFile::modeWrite | CFile::modeCreate))
25 {
26 return false;
27 }
28 }
29 catch ( CFileException /* e */)
30 {
31 return false;
32 }
33
34 return true;
35 }
36
37 void CTapeWriter::Close( void)
38 {
39 m_OutputFile->Close();
40 delete m_OutputFile;
41 m_OutputFile = NULL;
42 }
43
44 void CTapeWriter::WriteByte( byte value)
45 {
46 m_OutputFile->Write( &value, sizeof(value));
47 }

  ViewVC Help
Powered by ViewVC 1.1.26