#define _CRT_SECURE_NO_DEPRECATE #include "windows.h" #pragma warning(push) #pragma warning(disable : 4267 4244) #include <clientapi.h> #pragma warning( pop ) #include "fs.h" #include "fs_client.h" #include "fs_filesys.h" long long last_file_size = -1; FsClientUser::FsClientUser() : mSyncStatCallBack(NULL), mFileStatCallback(NULL) { } FileSys* FsClientUser::File(FileSysType type) { #ifdef _DEBUG printf("FsClientUser::File(%d)\n", type); #endif return new FsFileSys(type, last_file_size); } void FsClientUser::OutputStat(StrDict* varList) { StrRef var, val; int file_count = -1; long long sync_size = -1; const char* depot_file = NULL; const char* client_file = NULL; int rev = -1; const char* action = NULL; last_file_size = -1; for (int i = 0; varList->GetVar(i, var, val); ++i) { if (::strcmp(var.Text(), "fileSize") == 0) last_file_size = val.Atoi64(); else if (::strcmp(var.Text(), "totalFileSize") == 0) sync_size = val.Atoi64(); else if (::strcmp(var.Text(), "totalFileCount") == 0) file_count = val.Atoi(); else if (::strcmp(var.Text(), "depotFile") == 0) depot_file = val.Text(); else if (::strcmp(var.Text(), "clientFile") == 0) client_file = val.Text(); else if (::strcmp(var.Text(), "rev") == 0) rev = val.Atoi(); else if (::strcmp(var.Text(), "action") == 0) action = val.Text(); } if (mSyncStatCallBack && file_count >= 0) mSyncStatCallBack(file_count, sync_size); if (mFileStatCallback && last_file_size >= 0) mFileStatCallback(depot_file, client_file, action, rev, last_file_size); } void FsClientUser::HandleError(Error *inError) { // Collect all seen error messages so we can report them at the end. if (inError->GetSeverity() > E_WARN) { StrBuf msg; inError->Fmt(&msg); mErrorMessage += std::string(msg.Text()); } ClientUser::HandleError(inError); } void FsClientUser::SetSyncStatCallback(SyncStatCallbackFunc inSyncStatCallback) { mSyncStatCallBack = inSyncStatCallback; } void FsClientUser::SetFileStatCallback(FileStatCallbackFunc inFileStatCallback) { mFileStatCallback = inFileStatCallback; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 6451 | Frank Compagner |
- Now fully support unicode & utf-16 files - Improved accuracy of P4fsV progress bar - Added logging to help in remote debugging |
||
#2 | 6420 | Frank Compagner |
A number of improvements: - p4fs now supports the global -s (scripted output) option. - p4fs and P4fsV now support the modtime client option. - P4CHARSET is now correctly handled (though no full Unicode support yet). - Increased the maximum command line length for p4fs to the Windows maximum 32768. - Improved error handling. - Fixed a crash when cancelling a sync using the async or multithreaded writers. - P4fsV progressbar now behaves well when passing more than one filespec - P4fsV will now offer the option to overwrite any locally changed (but not checked out) files when it finds these during a sync (cannot clobber ...). - Made the P4fsV error dialog resizeable. - P4fsV Windows layout fixed so it works properly with all Windows style setings. - Ooh, and prettier icons too. |
||
#1 | 6187 | Frank Compagner | Added p4fs project |