Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
net_instaweb::ContentType Struct Reference

Public Types

enum  Type {
  kHtml, kXhtml, kCeHtml, kJavascript,
  kCss, kText, kXml, kPng,
  kGif, kJpeg, kSwf, kWebp,
  kIco, kJson, kSourceMap, kPdf,
  kVideo, kAudio, kOctetStream, kOther
}
 The MIME types we process. More...
 

Public Member Functions

const char * mime_type () const
 
const char * file_extension () const
 
Type type () const
 
bool IsCss () const
 Return true iff this content type is CSS.
 
bool IsJsLike () const
 Return true iff this content type is JS, or something similar like JSON.
 
bool IsHtmlLike () const
 
bool IsXmlLike () const
 
bool IsFlash () const
 Return true iff this content type is Flash.
 
bool IsImage () const
 Return true iff this content type is Image.
 
bool IsVideo () const
 Return true iff this content type is Video.
 
bool IsAudio () const
 Return true iff this content type is Audio.
 
bool IsLikelyStaticResource () const
 Heuristic to determine whether this should be treated as a static resource.
 
bool IsCompressible () const
 Heuristic to determine whether compressing the resource is beneficial.
 

Static Public Member Functions

static int MaxProducedExtensionLength ()
 

Public Attributes

const char * mime_type_
 
const char * file_extension_
 includes ".", e.g. ".ext"
 
Type type_
 

Member Enumeration Documentation

The MIME types we process.

Enumerator
kCeHtml 

See http://en.wikipedia.org/wiki/CE-HTML.

kOctetStream 

Binary resources.

kOther 

Used to specify a new local ContentType in one test file.

Member Function Documentation

const char* net_instaweb::ContentType::file_extension ( ) const
inline
Todo:
TODO(sligocki): Stop returning '.' in file_extension().
bool net_instaweb::ContentType::IsHtmlLike ( ) const

Return true iff this content type is HTML, or XHTML, or some other such thing (e.g. CE-HTML) that we can rewrite.

bool net_instaweb::ContentType::IsXmlLike ( ) const

Return true iff this content type is XML of some kind (either XHTML or some other XML).

static int net_instaweb::ContentType::MaxProducedExtensionLength ( )
static

Returns the maximum extension length of any resource types our filters can create. Does not count the ".". See RewriteDriver::CreateOutputResourceWithPath()

Member Data Documentation

const char* net_instaweb::ContentType::mime_type_

These fields should be private; we leave them public only so we can use struct literals in content_type.cc. Other code should use the above accessor methods instead of accessing these fields directly.


The documentation for this struct was generated from the following file: