String ResourceSpawnImplementation::getFamilyName() { int offset = 2; if(isUnknownType()) offset = 1; if(spawnClasses.size() > offset) return spawnClasses.get(spawnClasses.size() - offset); else return ""; }
String ResourceSpawnImplementation::getSurveyMissionSpawnFamilyName() { int offset = 3; if(isUnknownType() || isType("chemical")) offset = 2; if(spawnClasses.size() > offset) return spawnClasses.get(spawnClasses.size() - offset); else return ""; }
// http://tools.ietf.org/html/draft-abarth-mime-sniff-06#page-6 MIMESniffer::MIMESniffer(const char* advertisedMIMEType, bool isSupportedImageType) : m_dataSize(0) , m_function(0) { if (!advertisedMIMEType) { m_dataSize = 512; m_function = &unknownTypeSniffingProcedure; return; } if (isTextOrBinaryType(advertisedMIMEType)) { m_dataSize = 512; m_function = &textOrBinaryTypeSniffingProcedure; return; } if (isUnknownType(advertisedMIMEType)) { m_dataSize = 512; m_function = &unknownTypeSniffingProcedure; return; } if (isXMLType(advertisedMIMEType)) return; if (isSupportedImageType) { static const size_t dataSize = dataSizeNeededForImageSniffing(); m_dataSize = dataSize; m_function = &imageTypeSniffingProcedure; return; } if (!strcmp(advertisedMIMEType, "text/html")) { m_dataSize = 512; m_function = &feedTypeSniffingProcedure; return; } }