mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-11 15:50:38 -04:00
put some consts& around std::string in rsdir to improve performance
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3581 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
978528824b
commit
6fc8f8831b
2 changed files with 24 additions and 25 deletions
|
@ -36,18 +36,18 @@ class CRC32Map ;
|
|||
|
||||
namespace RsDirUtil {
|
||||
|
||||
std::string getTopDir(std::string);
|
||||
std::string getRootDir(std::string);
|
||||
std::string removeRootDir(std::string path);
|
||||
std::string removeTopDir(std::string dir);
|
||||
std::string removeRootDirs(std::string path, std::string root);
|
||||
std::string getTopDir(const std::string&);
|
||||
std::string getRootDir(const std::string&);
|
||||
std::string removeRootDir(const std::string& path);
|
||||
std::string removeTopDir(const std::string& dir);
|
||||
std::string removeRootDirs(const std::string& path, const std::string& root);
|
||||
|
||||
bool hashFile(const std::string& full_path,std::string& hash) ;
|
||||
|
||||
// Renames file from to file to. Files should be on the same file system.
|
||||
// returns true if succeed, false otherwise.
|
||||
bool renameFile(const std::string& from,const std::string& to) ;
|
||||
bool createBackup (std::string sFilename, unsigned int nCount = 5);
|
||||
bool createBackup (const std::string& sFilename, unsigned int nCount = 5);
|
||||
|
||||
// returns the CRC32 of the data of length len
|
||||
//
|
||||
|
@ -57,17 +57,16 @@ uint32_t rs_CRC32(const unsigned char *data,uint32_t len) ;
|
|||
//
|
||||
bool crc32File(FILE *f,uint64_t file_size,uint32_t chunk_size,CRC32Map& map) ;
|
||||
|
||||
int breakupDirList(std::string path,
|
||||
std::list<std::string> &subdirs);
|
||||
int breakupDirList(const std::string& path, std::list<std::string> &subdirs);
|
||||
|
||||
bool checkDirectory(std::string dir);
|
||||
bool checkCreateDirectory(std::string dir);
|
||||
bool cleanupDirectory(std::string dir, std::list<std::string> keepFiles);
|
||||
bool checkDirectory(const std::string& dir);
|
||||
bool checkCreateDirectory(const std::string& dir);
|
||||
bool cleanupDirectory(const std::string& dir, std::list<std::string> keepFiles);
|
||||
|
||||
bool hashFile(std::string filepath,
|
||||
bool hashFile(const std::string& filepath,
|
||||
std::string &name, std::string &hash, uint64_t &size);
|
||||
|
||||
bool getFileHash(std::string filepath,
|
||||
bool getFileHash(const std::string& filepath,
|
||||
std::string &hash, uint64_t &size);
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue