10 #ifndef CPLVRLAB_FTPUTILS_H
11 #define CPLVRLAB_FTPUTILS_H
13 #ifndef __EMSCRIPTEN__
26 const string& fileName,
27 const string& ftpHost,
28 const string& ftpUser,
34 const string& fileName,
35 const string& ftpHost,
36 const string& ftpUser,
42 const string& fileName,
43 const string& ftpHost,
44 const string& ftpUser,
50 const string& fileName,
51 const string& ftpHost,
52 const string& ftpUser,
58 const string& ftpHost,
59 const string& ftpUser,
62 const string& searchFileTag,
66 const string& localDir,
67 const string& searchFileTag,
68 vector<string>& retrievedFileNames,
72 const string& fileDir,
73 const string& fileName);
FtpUtils provides networking functionality via the FTP protocol.
bool getAllFileNamesWithTag(ftplib &ftp, const string &localDir, const string &searchFileTag, vector< string > &retrievedFileNames, string &errorMsg)
Get a list of all filenames with given search file tag in remote directory.
string getLatestFilename(ftplib &ftp, const string &fileDir, const string &fileName)
Returns the latest fileName of the same fullPathAndFilename.
bool uploadFile(const string &fileDir, const string &fileName, const string &ftpHost, const string &ftpUser, const string &ftpPwd, const string &ftpDir, string &errorMsg)
Uploads file to the ftp server.
bool downloadAllFilesFromDir(const string &fileDir, const string &ftpHost, const string &ftpUser, const string &ftpPwd, const string &ftpDir, const string &searchFileTag, string &errorMsg)
bool downloadFile(const string &fileDir, const string &fileName, const string &ftpHost, const string &ftpUser, const string &ftpPwd, const string &ftpDir, string &errorMsg)
Download file from the ftp server.
int getVersionInFilename(const string &filename)
Returns the version number at the end of the fileName.
bool uploadFileLatestVersion(const string &fileDir, const string &fileName, const string &ftpHost, const string &ftpUser, const string &ftpPwd, const string &ftpDir, string &errorMsg)
Uploads the file to the ftp server. Checks if the filename already exists and adds a version number.
bool downloadFileLatestVersion(const string &fileDir, const string &fileName, const string &ftpHost, const string &ftpUser, const string &ftpPwd, const string &ftpDir, string &errorMsg)
Download the file from the ftp server which has the latest version and store it as fileName locally.
void errorMsg(const char *tag, const char *msg, const int line, const char *file)
Platform independent error message output.