SLProject 4.0.000
FtpUtils Namespace Reference

FtpUtils provides networking functionality via the FTP protocol. More...

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
bool downloadAllFilesFromDir (const string &fileDir, const string &ftpHost, const string &ftpUser, const string &ftpPwd, const string &ftpDir, const string &searchFileTag, string &errorMsg)
 
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. More...
 
string getLatestFilename (ftplib &ftp, const string &fileDir, const string &fileName)
 Returns the latest fileName of the same fullPathAndFilename. More...
 
int getVersionInFilename (const string &filename)
 Returns the version number at the end of the fileName. More...
 

Detailed Description

FtpUtils provides networking functionality via the FTP protocol.

Function Documentation

◆ downloadAllFilesFromDir()

bool FtpUtils::downloadAllFilesFromDir ( const string &  fileDir,
const string &  ftpHost,
const string &  ftpUser,
const string &  ftpPwd,
const string &  ftpDir,
const string &  searchFileTag,
string &  errorMsg 
)
Parameters
fileDir
ftpHost
ftpUser
ftpPwd
ftpDir
searchFileTag
errorMsg
Returns

◆ downloadFile()

bool FtpUtils::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.

Parameters
fileDir
fileName
ftpHost
ftpUser
ftpPwd
ftpDir
errorMsg
Returns

◆ downloadFileLatestVersion()

bool FtpUtils::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.

Parameters
fileDir
fileName
ftpHost
ftpUser
ftpPwd
ftpDir
errorMsg
Returns

◆ getAllFileNamesWithTag()

bool FtpUtils::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.

Parameters
ftp
localDir
searchFileTag
retrievedFileNames
errorMsg
Returns

◆ getLatestFilename()

string FtpUtils::getLatestFilename ( ftplib &  ftp,
const string &  fileDir,
const string &  fileName 
)

Returns the latest fileName of the same fullPathAndFilename.

Parameters
ftp
fileDir
fileName
Returns

◆ getVersionInFilename()

int FtpUtils::getVersionInFilename ( const string &  filename)

Returns the version number at the end of the fileName.

Parameters
filenameFilename on ftp server with an ending *(#).ext
Returns
Returns the number in the brackets at the end of the filename

◆ uploadFile()

bool FtpUtils::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.

Parameters
fileDir
fileName
ftpHost
ftpUser
ftpPwd
ftpDir
errorMsg
Returns

◆ uploadFileLatestVersion()

bool FtpUtils::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.

Parameters
fileDir
fileName
ftpHost
ftpUser
ftpPwd
ftpDir
errorMsg
Returns