Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cFileCopier Class Reference

#include <cFileCopier.h>

Inheritance diagram for Gray::cFileCopier:
Gray::IFileCopier

Public Member Functions

virtual cStringA get_ConnectName () const override
 get a debug name for the connection. More...
 
virtual HRESULT Connect (const FILECHAR_t *pszServerRoot) override
 
virtual HRESULT RequestFile (const FILECHAR_t *pszSrcName, const FILECHAR_t *pszDestPath, IStreamProgressCallback *pProgress, FILE_SIZE_t nOffsetStart, FILE_SIZE_t *pnRequestSizeEst) override
 
virtual HRESULT SendFile (const FILECHAR_t *pszSrcPath, const FILECHAR_t *pszDestName, IStreamProgressCallback *pProgress, FILE_SIZE_t nOffsetStart, FILE_SIZE_t nSize) override
 
virtual HRESULT SendAttr (const FILECHAR_t *pszDestName, cTimeFile timeChanged) override
 
- Public Member Functions inherited from Gray::IFileCopier
virtual ~ IFileCopier ()
 

Static Public Member Functions

static HRESULT __stdcall CopyFileStream (cStreamInput &stmIn, const FILECHAR_t *pszDstFileName, bool bFailIfExists=false, IStreamProgressCallback *pProgress=nullptr)
 
static HRESULT __stdcall CopyFileX (const FILECHAR_t *pszExistingName, const FILECHAR_t *pszNewName, IStreamProgressCallback *pProgress=nullptr, bool bFailIfExists=false)
 
static HRESULT __stdcall RenamePath (const FILECHAR_t *pszOldName, const FILECHAR_t *pszNewName, IStreamProgressCallback *pProgress=nullptr)
 

Public Attributes

cStringF m_sServerRoot
 Prefix all server side paths with this. More...
 

Protected Member Functions

cStringF makeFilePath (const FILECHAR_t *pszFileName) const
 

Detailed Description

Implement the IFileCopier for the local file system. Copy single files.

Member Function Documentation

◆ Connect()

virtual HRESULT Gray::cFileCopier::Connect ( const FILECHAR_t pszServerRoot)
inlineoverridevirtual
  • pszServerRoot = server side names can be prefixed by "C:\etc"

Reimplemented from Gray::IFileCopier.

◆ CopyFileStream()

HRESULT GRAYCALL Gray::cFileCopier::CopyFileStream ( cStreamInput stmIn,
const FILECHAR_t pszDstFileName,
bool  bFailIfExists = false,
IStreamProgressCallback pProgress = nullptr 
)
static

Copy this (opened OF_READ) file to some other file name/path. (pszDstFileName) manually read/copy the contents of the file via WriteStream(). Similar effect to cFile::CopyFileX()

◆ CopyFileX()

HRESULT GRAYCALL Gray::cFileCopier::CopyFileX ( const FILECHAR_t pszExistingName,
const FILECHAR_t pszNewName,
IStreamProgressCallback pProgress = nullptr,
bool  bFailIfExists = false 
)
static

OS Copy a file from pszExistingName to pszNewName. The pszNewName may or may not already exist.

Note
you may want to call WriteFileTimes() after this.
Returns
ERROR_REQUEST_ABORTED = canceled by callback.

◆ get_ConnectName()

virtual cStringA Gray::cFileCopier::get_ConnectName ( ) const
inlineoverridevirtual

get a debug name for the connection.

get a debug name for the connection.

Implements Gray::IFileCopier.

◆ makeFilePath()

cStringF Gray::cFileCopier::makeFilePath ( const FILECHAR_t pszFileName) const
inlineprotected

◆ RenamePath()

HRESULT GRAYCALL Gray::cFileCopier::RenamePath ( const FILECHAR_t pszOldName,
const FILECHAR_t pszNewName,
IStreamProgressCallback pProgress = nullptr 
)
static

Equivalent of moving a file. (or directory and its children) A new directory must be on the same drive.

Note
Can't move file from once device to another! without MOVEFILE_COPY_ALLOWED
Returns
S_OK = 0 = good. <0 = failed.

◆ RequestFile()

HRESULT Gray::cFileCopier::RequestFile ( const FILECHAR_t pszSrcName,
const FILECHAR_t pszDestPath,
IStreamProgressCallback pProgress,
FILE_SIZE_t  nOffsetStart,
FILE_SIZE_t pnRequestSizeEst 
)
overridevirtual

Request a file from a m_sServerRoot/pszSrcName to be brought back to me at local pszDestPath.

  • pnRequestSizeEst = unused/unnecessary for local file system copy.

Reimplemented from Gray::IFileCopier.

◆ SendAttr()

HRESULT Gray::cFileCopier::SendAttr ( const FILECHAR_t pszDestName,
cTimeFile  timeChanged 
)
overridevirtual

Optionally set the remote side time stamp for a file.

Reimplemented from Gray::IFileCopier.

◆ SendFile()

HRESULT Gray::cFileCopier::SendFile ( const FILECHAR_t pszSrcPath,
const FILECHAR_t pszDestName,
IStreamProgressCallback pProgress,
FILE_SIZE_t  nOffsetStart,
FILE_SIZE_t  nSize 
)
overridevirtual

Send a local file to a m_sServerRoot/pszDestName from local pszSrcPath storage

Note
I cannot set the modification time stamp for the file here.

Reimplemented from Gray::IFileCopier.

Member Data Documentation

◆ m_sServerRoot

cStringF Gray::cFileCopier::m_sServerRoot

Prefix all server side paths with this.


The documentation for this class was generated from the following files: