本文整理汇总了C++中CFileReader::ReadFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileReader::ReadFile方法的具体用法?C++ CFileReader::ReadFile怎么用?C++ CFileReader::ReadFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileReader
的用法示例。
在下文中一共展示了CFileReader::ReadFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnReadJpeg
LRESULT CMainFrame::OnReadJpeg( WPARAM wParam, LPARAM lParam )
{
int nSegmentCount = 0;
CSegmentData *lpSegmentData = NULL;
CSegmentInfo *lpSegmentInfo = NULL;
CFileReader FileReader;
CJpegAnalyzer JpegAnalyzer;
CUserDatas* lpUserDatas = ((CIFuzzMakerDoc*)GetActiveDocument())->GetUserDatas();
lpUserDatas->GetReadBufferArray().RemoveAll();
if( !FileReader.ReadFile( lpUserDatas->GetJpegFileName(), lpUserDatas->GetReadBufferArray() ) )
{
// エラー
return FALSE;
}
// Jpeg解析
lpUserDatas->GetSegmentDataArray().RemoveAllWithDelete();
if( !JpegAnalyzer.Analyze( lpUserDatas->GetReadBufferArray(), m_FixedDatas.GetSegmentInfoMap(), lpUserDatas->GetSegmentDataArray() ) )
return FALSE;
// Exif解析
for(nSegmentCount=0; nSegmentCount<lpUserDatas->GetSegmentDataArray().GetSize(); nSegmentCount++ )
{
lpSegmentData = lpUserDatas->GetSegmentDataArray().GetAt( nSegmentCount );
if( lpSegmentData )
{
lpSegmentInfo = lpSegmentData->GetSegmentInfo();
if( lpSegmentInfo )
{
if( lpSegmentInfo->GetMarker() == _T("FFE1") )
{
CExifAnalyzer ExifAnalyzer;
ExifAnalyzer.Analyze( lpUserDatas->GetReadBufferArray().GetSize(), lpSegmentData, &m_FixedDatas.GetImageFileDirectoryInfoMap(), &m_FixedDatas.GetTagTypeInfoMap() );
}
if( lpSegmentInfo->IsAnalysisSegment() )
{
CSegmentAnalyzer SegmentAnalyzer;
SegmentAnalyzer.Analyze( lpUserDatas->GetReadBufferArray().GetSize(), lpSegmentData );
}
}
}
}
SendMessageToDescendants( WM_APP_EXIF_ANALYZED, NULL, NULL );
return TRUE;
}
示例2: OnReadGroup
//.........这里部分代码省略.........
}else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_DEC_32_LITTLE )
{
nDecValueInteger = (unsigned int)strtoul( szValue, NULL, 10 );
nDecValueInteger = CEndianConverter::ConvertToInteger( (unsigned char*)&nDecValueInteger, FALSE );
BinaryDataArray.SetSize( sizeof(nDecValueInteger) * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) );
lpBuffer = BinaryDataArray.GetData();
for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ )
{
CopyMemory( &lpBuffer[nRepeat*sizeof(nDecValueInteger)], &nDecValueInteger, sizeof(nDecValueInteger) );
}
}else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_DEC_32_BIG )
{
nDecValueInteger = (unsigned int)strtoul( szValue, NULL, 10 );
nDecValueInteger = CEndianConverter::ConvertToInteger( (unsigned char*)&nDecValueInteger, TRUE );
BinaryDataArray.SetSize( sizeof(nDecValueInteger) * (!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()) );
lpBuffer = BinaryDataArray.GetData();
for( int nRepeat=0; nRepeat<(!lpPatternInfo->GetRepeat()?1:lpPatternInfo->GetRepeat()); nRepeat++ )
{
CopyMemory( &lpBuffer[nRepeat*sizeof(nDecValueInteger)], &nDecValueInteger, sizeof(nDecValueInteger) );
}
}else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_HEX )
{
//
BinaryDataArray.SetSize( (int)(szValue.GetLength()/2) );
for( int cCnt=0; cCnt<(int)(szValue.GetLength()/2); cCnt++ )
{
unsigned int nVal = strtol( szValue.Mid( cCnt*2, 2 ),NULL,16 );
BinaryDataArray.SetAt(cCnt, nVal);
}
}else if( lpPatternInfo->GetDataType() == CPatternData::DATATYPE_BIN )
{
//
CFileReader fl;
if( !fl.ReadFile( lpPatternInfo->GetFileName(), BinaryDataArray ) )
continue;
}
lpPatternGroupData->GetPatternDataArray()->AddWithNew( lpPatternData );
lpPatternData->SetCheck( lpPatternInfo->GetSelectFlag() );
lpPatternData->SetDispName( lpPatternInfo->GetDispName() );
lpPatternData->SetDataType( lpPatternInfo->GetDataType() );
lpPatternData->SetValue( lpPatternInfo->GetValue() );
lpPatternData->SetRepeat( lpPatternInfo->GetRepeat() );
lpPatternData->SetWriteMode( lpPatternInfo->GetWriteMode() );
lpPatternData->SetFuzzArea( lpPatternInfo->GetFuzzArea() );
lpPatternData->SetSearchField( lpPatternInfo->GetSearchField() );
lpPatternData->SetFieldKey( lpPatternInfo->GetFieldKey() );
lpPatternData->SetDescription( lpPatternInfo->GetDescription() );
lpPatternData->SetBinaryDataArray( BinaryDataArray );
if( lpPatternInfo->GetFuzzArea() == CPatternData::FUZZAREA_FILE )
{
TCHAR* endptr = NULL;
int nFilePos = _tcstol( lpPatternInfo->GetFieldKey(), &endptr, 10 );
if( _tcslen(endptr) )
continue;
lpPatternData->SetFilePos( nFilePos );
}
if( lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_TAG ||
lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_TYPE ||
lpPatternData->GetSearchField() == CPatternData::SEARCHFIELD_SEGMENT )
{
POSITION pos = NULL;
CString szKey;
CImageFileDirectoryInfo *lpImageFileDirectoryInfo = NULL;