?? snimacbin.cpp
字號:
// SnimacBin.cpp: implementation of the CSnimacBin class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "SnimacBin.h"
#include "Win32File.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CSnimacBin::CSnimacBin(const std::string& nazivFajla)
: CSnimacFajl(nazivFajla)
{
}
CSnimacBin::CSnimacBin(CFile* pFajl)
: CSnimacFajl(pFajl)
{
}
CSnimacBin::~CSnimacBin()
{
}
void CSnimacBin::SnimiSledeciBajt(PRG::tBajt bajt, PRG::tAdresa adresa)
{
std::string opis;
if (!ProveriFajlPtr(opis)) throw CSnimacException(opis);
const int BROJ_BAJTOVA = 1; // upisujem po jedan bajt
BYTE buffer[BROJ_BAJTOVA]; // bafer za upis
try {
buffer[0] = bajt;
pFajl_m->Write(buffer, sizeof(buffer));
}
catch (CFileException* e) {
std::string tekstGreske = CWin32File::ExceptionToTxt(*e, "CFileException");
e->Delete();
throw CSnimacException(tekstGreske);
}
catch (...) {
throw CSnimacException("error writing file");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -