Logo Search packages:      
Sourcecode: earth3d version File versions  Download package

QString FileCache::createFilename ( QString  url  )  [protected]

Builds a filename for the given url. It uses an md5 sum where the first characters are used as directory names to distribute the files over several directories.

Definition at line 174 of file fileCache.cpp.

References hexString().

Referenced by addFile(), contains(), and read().

  md5_context ctx;
  uint8 digest[16];

  // build md5 sum

  md5_update(&ctx, (unsigned char *) url.latin1(), url.length());
  md5_finish(&ctx, digest);

  // build string. The first three hex numbers are treated as directories to support filesystems that have limits
  // on how many files are allowed in one directory.

  QString result;
  for(int i=0; i<16; i++) {
    if (i<CACHE_DIRS_DEPTH) {


Generated by  Doxygen 1.6.0   Back to index