![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cSyncDir.h>
Public Member Functions | |
| cSyncContext (cStringF sDirRoot, const FILECHAR_t *pszManifestFileName=nullptr, cLogProcessor *pLog=nullptr, IStreamProgressCallback *pProgress=nullptr) | |
| cSyncContext (const cManifestContext &context) | |
| ~cSyncContext () | |
| HRESULT _cdecl | LogFileOpf (LOG_ATTR_MASK_t uAttrMask, LOGLEV_TYPE eLogLevel, const FILECHAR_t *pszFile, const LOGCHAR_t *pszFormat,...) |
| HRESULT | SendFile (cStringF sFilePathSrc, cStringF sRelPathDest, IStreamProgressCallback *pProgress1=nullptr, FILE_SIZE_t nOffset=0, FILE_SIZE_t nSize=(FILE_SIZE_t) -1) |
| HRESULT | RequestFile (cStringF sRelPathSrc, cStringF sFilePathDest, IStreamProgressCallback *pProgress1=nullptr, FILE_SIZE_t nOffset=0, FILE_SIZE_t *pnSizeEst=nullptr) |
| cStringF | GetManifestCacheName (cStringF sManRemoteDir) const |
| HRESULT | FlushManifestCache (cStringF sManRemoteDir="") |
| HRESULT | SyncManifestFromCache (cManifestDir &manRemote, cStringF sManRemoteDest) |
| HRESULT | SyncManifestFromRemote2 (cManifestDir &manRemote, cStringF sManRemoteDir, cStringF sManifestCacheName) |
| HRESULT | SyncManifestFromRemote (cManifestDir &manRemote, cStringF sManRemoteDir) |
| HRESULT | SyncIfChanged (cManifestDir &manRemote, const FILECHAR_t *pszSrcName, const FILECHAR_t *pszLocalName=nullptr) |
| HRESULT | SyncDirPackage (cStringF sPathLocalDir) |
| HRESULT | SetLocalAttr (const FILECHAR_t *pszLocalPath, const cManifestElem *pFileDst, bool bSetName) |
| HRESULT | SetLocalAttrAndCRC (const FILECHAR_t *pszLocalPath, const cManifestElem *pFileDst, bool bSetName) |
| HRESULT | SetLocalAttr2 (const FILECHAR_t *pszLocalPath, const cManifestElem *pFileDst, bool bSetName) |
Public Member Functions inherited from GrayLib::cManifestContext | |
| cManifestContext (cStringF sDirRoot, const FILECHAR_t *pszManifestFileName=nullptr, cLogProcessor *pLog=nullptr, IStreamProgressCallback *pProgress=nullptr) | |
| ~cManifestContext () | |
| HRESULT | UpdateProgress (const cStreamProgress &s) |
Public Member Functions inherited from GrayLib::cManifestRoot | |
| cManifestRoot (cStringF sRootDir, const FILECHAR_t *pszManifestFileName=nullptr) | |
| ~cManifestRoot () | |
| cStringF | get_RootDir () const |
| void | put_RootDir (cStringF sRootDir) |
| bool | isRootDir (const FILECHAR_t *pszDirPath) const |
| bool | isInRootPath (const FILECHAR_t *pszDirPath) const |
| cStringF | makeFullPath (const FILECHAR_t *pszRelativePath) const |
| cStringF | makeRelativePath (const FILECHAR_t *pszDirPath) const |
| HRESULT | ReadSearchForTitle (cStringF &sPathRet, const FILECHAR_t *pszTitle, int iDescendLevels) const |
Static Public Member Functions | |
| static HRESULT GRAYCALL | DoMoveLimboFiles (const FILECHAR_t *pszRootDir, cLogProcessor *pLog, IStreamProgressCallback *pProgress) |
Public Attributes | |
| IFileCopier * | m_pRemoteConnect |
| transfer remote files via this connection to a remote file system. If we are CSYNC_Push then it must allow time stamp setting. More... | |
| cSyncOpPtr | m_pOpRoot |
| full list/tree of operations to be performed on all dirs More... | |
| TIMESECD_t | m_nManifestCacheAge |
| allow remote/server Manifest cache to be this old. (seconds), 0=no cache. More... | |
| cStringF | m_sManCachePrefix |
| file path prefix (Destination directory) for caching manifests. More... | |
| cStreamProgress | m_Rx |
| total file data to pull. More... | |
| cStreamProgress | m_Tx |
| total file data to push. More... | |
Public Attributes inherited from GrayLib::cManifestContext | |
| cLogProcessor * | m_pLog |
| Route status messages to this logger. More... | |
| IStreamProgressCallback * | m_pProgress |
| Send progress info to some outside party on the action(s) we are taking. More... | |
Public Attributes inherited from GrayLib::cManifestRoot | |
| const FILECHAR_t * | m_pszManifestFileName |
| "Manifest.scp" // name of the local manifest files. (one per dir) More... | |
Static Public Attributes | |
| static const FILECHAR_t | sm_szLimboDir [] = _FN("synclimbo") |
| put files here that are locked when i try to sync them. More... | |
Static Public Attributes inherited from GrayLib::cManifestRoot | |
| static const FILECHAR_t * | k_pszManifestDefault = _FN("Manifest.scp") |
| "Manifest.scp" More... | |
Additional Inherited Members | |
Protected Attributes inherited from GrayLib::cManifestRoot | |
| cStringF | m_sRootDir |
| full path to the (local system) root directory we are syncing or building manifests for. More... | |
we are building a list of sync actions or we are actually performing those actions. Use IStreamProgressCallback to get the progress callback from a single action.
| GrayLib::cSyncContext::cSyncContext | ( | cStringF | sDirRoot, |
| const FILECHAR_t * | pszManifestFileName = nullptr, |
||
| cLogProcessor * | pLog = nullptr, |
||
| IStreamProgressCallback * | pProgress = nullptr |
||
| ) |
| GrayLib::cSyncContext::cSyncContext | ( | const cManifestContext & | context | ) |
| GrayLib::cSyncContext::~cSyncContext | ( | ) |
|
static |
Move any limbo files before doing anything else.
Assume the server/remove side has changed. Cache is invalid!
Create a full local path name for a cached element. assume we check the date on the cache to age it out.
| HRESULT _cdecl GrayLib::cSyncContext::LogFileOpf | ( | LOG_ATTR_MASK_t | uAttrMask, |
| LOGLEV_TYPE | eLogLevel, | ||
| const FILECHAR_t * | pszFile, | ||
| const LOGCHAR_t * | pszFormat, | ||
| ... | |||
| ) |
Log that some operation occurred on the file.
| HRESULT GrayLib::cSyncContext::RequestFile | ( | cStringF | sRelPathSrc, |
| cStringF | sFilePathDest, | ||
| IStreamProgressCallback * | pProgress1 = nullptr, |
||
| FILE_SIZE_t | nOffset = 0, |
||
| FILE_SIZE_t * | pnSizeEst = nullptr |
||
| ) |
Request a file from the remote/server and receive response. Don't care why at this point. like IFileCopier
| HRESULT GrayLib::cSyncContext::SendFile | ( | cStringF | sFilePathSrc, |
| cStringF | sRelPathDest, | ||
| IStreamProgressCallback * | pProgress1 = nullptr, |
||
| FILE_SIZE_t | nOffset = 0, |
||
| FILE_SIZE_t | nSize = (FILE_SIZE_t)-1 |
||
| ) |
Send a local file to the remote. like IFileCopier
| HRESULT GrayLib::cSyncContext::SetLocalAttr | ( | const FILECHAR_t * | pszLocalPath, |
| const cManifestElem * | pFileDst, | ||
| bool | bSetName | ||
| ) |
the file contents are the same. Set (make sure) the local file has same attributes.
| HRESULT GrayLib::cSyncContext::SetLocalAttr2 | ( | const FILECHAR_t * | pszLocalPath, |
| const cManifestElem * | pFileDst, | ||
| bool | bSetName | ||
| ) |
Validate the CRC of the Rx file. If invalid then delete the file.
| HRESULT GrayLib::cSyncContext::SetLocalAttrAndCRC | ( | const FILECHAR_t * | pszLocalPath, |
| const cManifestElem * | pFileDst, | ||
| bool | bSetName | ||
| ) |
Double check all PE/EXE content for signing.
Ask for a directory/package as a zip file from the remote/server.
| HRESULT GrayLib::cSyncContext::SyncIfChanged | ( | cManifestDir & | manRemote, |
| const FILECHAR_t * | pszSrcName, | ||
| const FILECHAR_t * | pszLocalName = nullptr |
||
| ) |
Special Check for a specific file in the manifest. (Not normal mechanism) if it has changed then get it from the remote/server.
| HRESULT GrayLib::cSyncContext::SyncManifestFromCache | ( | cManifestDir & | manRemote, |
| cStringF | sManRemoteDest | ||
| ) |
Get remote side manifest from cache?
| HRESULT GrayLib::cSyncContext::SyncManifestFromRemote | ( | cManifestDir & | manRemote, |
| cStringF | sManRemoteDir | ||
| ) |
Request the Remote manifest list for this folder from the remote/server. The Remote/server manifest file is what it is supposed to be vs What we actually have locally. sManRemoteDir = makeRelativePath( manRemote.get_DirPath()) HRESULT_WIN32_C(ERROR_INVALID_TABLE) = corrupt file.
| HRESULT GrayLib::cSyncContext::SyncManifestFromRemote2 | ( | cManifestDir & | manRemote, |
| cStringF | sManRemoteDir, | ||
| cStringF | sManifestCacheName | ||
| ) |
Request the Remote manifest list for this folder from the remote/server. The Remote/server manifest file is what it is supposed to be vs What we actually have locally. HRESULT_WIN32_C(ERROR_INVALID_TABLE) = corrupt file.
| TIMESECD_t GrayLib::cSyncContext::m_nManifestCacheAge |
allow remote/server Manifest cache to be this old. (seconds), 0=no cache.
| cSyncOpPtr GrayLib::cSyncContext::m_pOpRoot |
full list/tree of operations to be performed on all dirs
| IFileCopier* GrayLib::cSyncContext::m_pRemoteConnect |
transfer remote files via this connection to a remote file system. If we are CSYNC_Push then it must allow time stamp setting.
| cStreamProgress GrayLib::cSyncContext::m_Rx |
total file data to pull.
| cStringF GrayLib::cSyncContext::m_sManCachePrefix |
file path prefix (Destination directory) for caching manifests.
| cStreamProgress GrayLib::cSyncContext::m_Tx |
total file data to push.
|
static |
put files here that are locked when i try to sync them.
put new files here that are locked when i try to sync (replace) them. So we can try again later?