Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
filestream.h
#ifndef CFILESTREAM_H__
#define CFILESTREAM_H__ 1
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory>
#include "p6xjr.h"
class CFileStream : public P6R::p6IDataStream
{
public:
{
return m_cRef++;
}
{
P6R::P6INT32 tmp = 0;
if(0 == (tmp = (--m_cRef))) { delete this; }
return tmp;
}
P6COMMETHOD initialize( const P6R::P6CHAR *pFilePath );
static P6R::P6ERR createInstance( P6R::p6ICom *pOuter, const P6REFIID iid, P6R::P6VOID **ppIface )
{
P6R::P6ERR err = P6R::eNoMemory;
CFileStream *pObj = NULL;
if (NULL != (pObj = new (std::nothrow) CFileStream() ))
{
if (P6FAILED( err = pObj->queryInterface( iid, ppIface ))) delete pObj;
}
return err;
}
CFileStream() : m_cRef( 0 ),
m_bInitialized( false ),
m_pFile( NULL ),
m_pFilePath( NULL ) {}
virtual ~CFileStream();
protected:
P6R::P6INT32 m_cRef;
P6R::P6BOOL m_bInitialized;
FILE* m_pFile;
P6R::P6CHAR* m_pFilePath;
};
#endif