Ejemplo n.º 1
0
void File::throwError(char *pFilename, DWORD pError) {
  
   /* If we know this type of error throw a special case */
   switch (pError) {
      case ERROR_DISK_FULL:
         throw DiskFullException(pFilename);
      case ERROR_ACCESS_DENIED:
         throw AccessDeniedException(pFilename);
      default:
          throw ErrorException(pFilename, pError);
   }
}
Ejemplo n.º 2
0
	QString StorageManager::ResolvePath (QUrl url) const
	{
		if (url.path ().startsWith ("/"))
			url.setPath (url.path ().mid (1));

		const auto& path = QUrl::fromLocalFile (QDir::homePath () + '/')
				.resolved (url).toLocalFile ();
		const QFileInfo fi { path };
		if (!fi.absoluteFilePath ().startsWith (QDir::homePath ()))
			throw AccessDeniedException ();

		return path;
	}
Ejemplo n.º 3
0
void AccessDeniedException::rethrow () const
{
	throw AccessDeniedException (error);
}