viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1.  
  2. using System;
  3.  
  4. namespace Dizzy
  5. {
  6.  
  7.  
  8. public class FileType {
  9.  
  10. int type;
  11. const int UNKNOWN = 0;
  12. const int VIDEO = 1;
  13. const int AUDIO = 2;
  14. const int BOOK = 3;
  15.  
  16. public FileType(string filename) {
  17.  
  18. if(filename.EndsWith(".avi"))
  19. type = VIDEO;
  20. else if(filename.EndsWith(".pdf"))
  21. type = BOOK;
  22. else if(filename.EndsWith(".mp3"))
  23. type = AUDIO;
  24. else
  25. type = UNKNOWN;
  26.  
  27. }
  28.  
  29. public string Name()
  30. {
  31. if(type == VIDEO)
  32. return "Video";
  33. else if(type == BOOK)
  34. return "Book";
  35. else if(type == AUDIO)
  36. return "Audio";
  37. else
  38. return "Sconosciuto";
  39. }
  40. }
  41.  
  42. public class File
  43. {
  44.  
  45. public ulong size;
  46. public string user;
  47. public string name;
  48. public string path;
  49. public FileType type;
  50.  
  51. public File (string path, ulong size, string user)
  52. {
  53. // Determino il tipo di file
  54. type = new FileType (path);
  55. this.size = size;
  56. this.user = user;
  57. string[] pieces = path.Split ('/');
  58.  
  59. name = pieces[pieces.Length - 1];
  60.  
  61. }
  62.  
  63. public string SizeToString()
  64. {
  65. ulong t_size = size;
  66. if(t_size < 1024)
  67. return t_size.ToString () + " B";
  68. t_size /= 1024;
  69. if(t_size < 1024)
  70. return t_size.ToString () + " KB";
  71. t_size /= 1024;
  72. if(t_size < 1024)
  73. return t_size.ToString () + "MB";
  74. t_size /= 1024;
  75. if(t_size < 1024)
  76. return t_size.ToString () + "GB";
  77. return "Unknown";
  78. }
  79. }
  80. }