SAUCE (Standard Architecture for Universal Comment Extensions) parser in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

type.go 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. package sauce
  2. const (
  3. DataTypeNone uint8 = iota
  4. DataTypeCharacter
  5. DataTypeBitmap
  6. DataTypeVector
  7. DataTypeAudio
  8. DataTypeBinaryText
  9. DataTypeXBIN
  10. DataTypeArchive
  11. DataTypeExecutable
  12. )
  13. var (
  14. DataType = map[uint8]string{
  15. DataTypeNone: "None",
  16. DataTypeCharacter: "Character",
  17. DataTypeBitmap: "Bitmap",
  18. DataTypeVector: "Vector",
  19. DataTypeAudio: "Audio",
  20. DataTypeBinaryText: "BinaryText",
  21. DataTypeXBIN: "XBin",
  22. DataTypeArchive: "Archive",
  23. DataTypeExecutable: "Executable",
  24. }
  25. FileType = map[uint8]map[uint8]string{
  26. DataTypeCharacter: map[uint8]string{
  27. 0: "ASCII",
  28. 1: "ANSi",
  29. 2: "ANSiMation",
  30. 3: "RIP script",
  31. 4: "PCBoard",
  32. 5: "Avatar",
  33. 6: "HTML",
  34. 7: "Source",
  35. 8: "Tundradraw",
  36. },
  37. DataTypeBitmap: map[uint8]string{
  38. 0: "GIF",
  39. 1: "PCX",
  40. 2: "LBM/FF",
  41. 3: "TGA",
  42. 4: "FLI",
  43. 5: "FLC",
  44. 6: "BMP",
  45. 7: "GL",
  46. 8: "DL",
  47. 9: "WPG",
  48. 10: "PNG",
  49. 11: "JPG",
  50. 12: "MPG",
  51. 13: "AVI",
  52. },
  53. DataTypeVector: map[uint8]string{
  54. 0: "DXF",
  55. 1: "DWG",
  56. 2: "WPG",
  57. 3: "3DS",
  58. },
  59. DataTypeAudio: map[uint8]string{
  60. 0: "MOD",
  61. 1: "669",
  62. 2: "STM",
  63. 3: "S3M",
  64. 4: "MTM",
  65. 5: "FAR",
  66. 6: "ULT",
  67. 7: "AMF",
  68. 8: "DMF",
  69. 9: "OKT",
  70. 10: "ROL",
  71. 11: "CMF",
  72. 12: "MID",
  73. 13: "SADT",
  74. 14: "VOC",
  75. 15: "WAV",
  76. 16: "SMP8",
  77. 17: "SMP8S",
  78. 18: "SMP16",
  79. 19: "SMP16S",
  80. 20: "PATCH8",
  81. 21: "PATCH16",
  82. 22: "XM",
  83. 23: "HSC",
  84. 24: "IT",
  85. },
  86. DataTypeArchive: map[uint8]string{
  87. 0: "ZIP",
  88. 1: "ARJ",
  89. 2: "LZH",
  90. 3: "ARC",
  91. 4: "TAR",
  92. 5: "ZOO",
  93. 6: "RAR",
  94. 7: "UC2",
  95. 8: "PAK",
  96. 9: "SQZ",
  97. },
  98. }
  99. MimeType = map[uint8]map[uint8]string{
  100. DataTypeCharacter: map[uint8]string{
  101. 0: "text/plain",
  102. 1: "text/plain",
  103. 2: "text/plain",
  104. 3: "image/x-rip",
  105. 4: "text/plain",
  106. 5: "image/x-avatar",
  107. 6: "text/html",
  108. 7: "text/plain",
  109. 8: "image/x-tnd",
  110. },
  111. DataTypeBitmap: map[uint8]string{
  112. 0: "image/gif",
  113. 1: "image/pcx",
  114. 2: "image/lbm",
  115. 3: "image/tga",
  116. 4: "video/fli",
  117. 5: "video/flc",
  118. 6: "image/bmp",
  119. 7: "video/x-gl",
  120. 8: "video/x-dl",
  121. 9: "image/wpg",
  122. 10: "image/png",
  123. 11: "image/jpeg",
  124. 12: "video/mpeg",
  125. 13: "video/x-msvideo",
  126. },
  127. DataTypeVector: map[uint8]string{
  128. 0: "image/vnd.dxf",
  129. 1: "image/vnd.dwg",
  130. 2: "image/vnd.wpg",
  131. 3: "image/x-3ds",
  132. },
  133. DataTypeAudio: map[uint8]string{
  134. 0: "audio/x-mod",
  135. 1: "audio/x-mod",
  136. 2: "audio/x-mod",
  137. 3: "audio/x-mod",
  138. 4: "audio/x-mod",
  139. 5: "audio/x-mod",
  140. 6: "audio/x-mod",
  141. 7: "audio/x-mod",
  142. 8: "audio/x-mod",
  143. 12: "audio/midi",
  144. 15: "audio/x-wav",
  145. 16: "SMP8",
  146. 17: "SMP8S",
  147. 18: "SMP16",
  148. 19: "SMP16S",
  149. 20: "PATCH8",
  150. 21: "PATCH16",
  151. 22: "audio/x-mod",
  152. 23: "audio/x-mod",
  153. 24: "audio/x-mod",
  154. },
  155. DataTypeArchive: map[uint8]string{
  156. 0: "application/zip",
  157. 1: "application/arj",
  158. 2: "application/x-lzh",
  159. 3: "application/x-arc",
  160. 4: "application/x-tar",
  161. 5: "application/x-zoo",
  162. 6: "application/rar",
  163. 7: "application/x-uc2",
  164. 8: "application/x-pak",
  165. 9: "applicaiton/x-sqz",
  166. },
  167. }
  168. )