#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Sat, 12 May 2018 14:23:45 +0200
changeset 4088 bbf9b58f99c8
parent 4087 d9336080778d
child 4089 a64828e69680
#FEATURE by cg class: MIMETypes class changed: #initializeFileInfoMappings class: MIMETypes::MIMEType added: #asMimeType #isCHeaderType #isCPPSourceType #isCSourceType
MIMETypes.st
--- a/MIMETypes.st	Fri May 11 13:09:47 2018 +0200
+++ b/MIMETypes.st	Sat May 12 14:23:45 2018 +0200
@@ -317,6 +317,7 @@
     TypeToInfoMapping at:'application/x-lisp-source' put:'Lisp source'.
     TypeToInfoMapping at:'application/x-scheme-source' put:'Scheme source'.
     TypeToInfoMapping at:'application/x-python-source' put:'Python source'.
+    TypeToInfoMapping at:'application/x-ruby-source' put:'Ruby source'.
 
     TypeToInfoMapping at:'application/x-make' put:'make rules'.
     TypeToInfoMapping at:'application/binary' put:'binary object file'.
@@ -1641,6 +1642,12 @@
     "Modified (comment): / 09-02-2017 / 15:36:06 / stefan"
 ! !
 
+!MIMETypes::MIMEType methodsFor:'converting'!
+
+asMimeType
+    ^ self
+! !
+
 !MIMETypes::MIMEType methodsFor:'queries'!
 
 fileTypeInfo
@@ -1685,6 +1692,24 @@
     ^ self isTextType not
 !
 
+isCHeaderType
+    "return true, if I represent a C header file type"
+
+    ^ (self startsWith: 'application/x-c-header')
+!
+
+isCPPSourceType
+    "return true, if I represent a C++ sourcecode type"
+
+    ^ (self startsWith: 'application/x-cpp-source')
+!
+
+isCSourceType
+    "return true, if I represent a C sourcecode type"
+
+    ^ (self startsWith: 'application/x-c-source')
+!
+
 isHtml
     <resource: #obsolete>
     "return true, if I represent the html text type"