home *** CD-ROM | disk | FTP | other *** search
- //
- // CStgFile.h
- //+
- // header file
- //-
- // rev 11/04/98 gls added isOpen()
- // rev 11/03/98 gls
- //
-
- #if !defined(AFX_CSTGFILE_H__44A6BBE4_7363_11D2_A233_B4D39F7DF00D__INCLUDED_)
- #define AFX_CSTGFILE_H__44A6BBE4_7363_11D2_A233_B4D39F7DF00D__INCLUDED_
-
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CStgFile window
-
- class CStgFile : public CFile
- {
-
- IStorage *m_pStgRoot; // open storage
-
- IStorage *m_pStgStreamOpen; // storage for current open stream
- COleStreamFile *m_pStreamOpen; // pointer if stream is open
-
- int printf( const char *format, ... ) { return(0); }
-
-
- // Construction
- public:
- CStgFile();
-
- // Attributes
- public:
-
- // Operations
- public:
-
- BOOL OpenStg( LPCSTR pszFileStg );
- BOOL CreateStg( LPCSTR pszFileStg );
- BOOL CloseStg( void );
- BOOL MkStg( LPCSTR pszStg );
-
- BOOL isOpen( void )
- {
- return( m_pStgRoot != NULL ? TRUE : FALSE );
- }
-
-
-
- BOOL Enum( IStorage *pStg = NULL, LPCSTR pszStgStart = NULL,
- BOOL (*pFunc)(void *pContext, LPCSTR pszStgPrefix, STATSTG *pStat ) = NULL,
- void *pContextCallback = NULL );
-
- BOOL EnumStreams( CStringArray &rgStreams, LPCSTR pszPattern = NULL );
-
- virtual BOOL OnEnumStg( LPCSTR pszStgPrefix, STATSTG *pStat )
- {
- printf( "CStgFile:: OnEnumStg( %s\\%s )\n",
- pszStgPrefix, CString( pStat->pwcsName ) );
-
- return( TRUE );
- }
-
- virtual BOOL OnEnumStream( LPCSTR pszStgPrefix, STATSTG *pStat )
- {
- printf( "CStgFile:: OnEnumStream( %s\\%s )\n",
- pszStgPrefix, CString( pStat->pwcsName ) );
-
- return( TRUE );
- }
-
- IStorage *getStgRoot()
- {
- return( m_pStgRoot );
- }
-
-
- public:
- //
- // Overrides to switch between external and document stream
- //
- virtual BOOL Open( LPCTSTR lpszFileName, UINT nOpenFlags, CFileException* pError = NULL );
- virtual void Close( void );
- virtual void Write( const void* lpBuf, UINT nCount );
- virtual UINT Read( void* lpBuf, UINT nCount );
- virtual void Flush( );
- virtual LONG Seek( LONG lOff, UINT nFrom );
-
-
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CStgFile)
- //}}AFX_VIRTUAL
-
- // Implementation
- public:
- virtual ~CStgFile();
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(CStgFile)
- // NOTE - the ClassWizard will add and remove member functions here.
- //}}AFX_MSG
- };
-
- /////////////////////////////////////////////////////////////////////////////
-
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
- #endif // !defined(AFX_CSTGFILE_H__44A6BBE4_7363_11D2_A233_B4D39F7DF00D__INCLUDED_)
-
-
- // ////////////////////////////////////////////////////////////
- // ////////////////////////////////////////////////////////////
- // ////////////////////////////////////////////////////////////
-