#include <nativeps.h>
Inheritance diagram for NativeExportDC:
Public Member Functions | |
NativeExportDC (Filter *) | |
Constructor for the NativeExportDC. This does nothing, except call the base class constructor. | |
virtual INT32 | OutputRawBinary (BYTE *Data, UINT32 Length, UINT32 Alignment=1) |
Outputs a sequence of bytes as raw data. |
Definition at line 275 of file nativeps.h.
|
Constructor for the NativeExportDC. This does nothing, except call the base class constructor.
Definition at line 2643 of file nativeps.cpp. 02643 : EPSExportDC(pFilter) 02644 { 02645 }
|
|
Outputs a sequence of bytes as raw data.
Reimplemented from KernelDC. Definition at line 2668 of file nativeps.cpp. 02669 { 02670 // Param to note how many bytes we are writing out to the file 02671 INT32 nBytes = 0; 02672 02673 // Start off with a blank line 02674 if (!OutputNewLine()) 02675 // Error encountered 02676 return -1; 02677 02678 // Set the mode to binary 02679 //ExportFile.setMode(filebuf::binary); 02680 02681 // Output a character to mark the begining of the binary section 02682 static TCHAR Begin = _T('>'); 02683 if (!OutputTCHARAsChar(&Begin, 1)) 02684 // Error 02685 return -1; 02686 02687 // Output the line of binary data 02688 if (!OutputDirect(Data, Length)) 02689 { 02690 // Error 02691 return -1; 02692 } 02693 02694 // We saved out 'Length' bytes there 02695 nBytes += Length; 02696 02697 // Work out the padding needed 02698 ENSURE(Alignment != 0, "Bad alignment in OutputRawBinary!"); 02699 UINT32 Padding = Alignment - (Length % Alignment); 02700 if (Padding == Alignment) 02701 Padding = 0; 02702 02703 if (Padding > 0) 02704 { 02705 // Put the string into a Buffer 02706 TCHAR Buffer[2]; 02707 Buffer[0] = 0; 02708 Buffer[1] = 0; 02709 02710 // Output it however many times we need to 02711 while (Padding > 0) 02712 { 02713 if (OutputTCHARAsChar(Buffer, 1)) 02714 // Error 02715 return -1; 02716 02717 nBytes++; 02718 Padding--; 02719 } 02720 } 02721 02722 //output an end marker 02723 static TCHAR End = _T('<'); 02724 if (!OutputTCHARAsChar(&End, 1)) 02725 // Error 02726 return -1; 02727 02728 // Set the mode to binary 02729 //ExportFile.setMode(filebuf::text); 02730 02731 // All done 02732 return nBytes; 02733 }
|