Added avatar manager which will help when transfering and caching avatars. Using boost::filesystem. MD5 sum is used to identify avatars, different types of files are possible. Avatar cache (and the avatars provided) use for example <md5sum>.png as file names, so that no additional storage for the md5sum is required.

A cache directory with write permissions is required, however, as avatars are not cached in RAM.
This commit is contained in:
lotodore
2007-09-08 16:26:10 +00:00
parent 2f1e371e4f
commit db208190be
5 changed files with 197 additions and 2 deletions
+6 -1
View File
@@ -89,11 +89,16 @@ MD5Buf::FromString(const std::string &text)
}
bool
MD5Buf::operator==(const MD5Buf &other)
MD5Buf::operator==(const MD5Buf &other) const
{
return memcmp(data, other.data, MD5_DATA_SIZE) == 0;
}
bool
MD5Buf::operator<(const MD5Buf &other) const
{
return memcmp(data, other.data, MD5_DATA_SIZE) < 0;
}
bool
CryptHelper::MD5Sum(const std::string &fileName, MD5Buf &buf)