bool FilterState::shouldDescend(const std::string& name) { bool inc = containsName(m_Include, name); bool exc = containsName(m_Exclude, name); if (inc) return true; else if (exc) return false; else return m_Type == InclusiveFilter; }
int32_t PropNameData::getPropertyOrValueEnum(int32_t bytesTrieOffset, const char *alias) { BytesTrie trie(bytesTries+bytesTrieOffset); if(containsName(trie, alias)) { return trie.getValue(); } else { return UCHAR_INVALID_CODE; } }
void PeerTable::add(const Peer& peer) { if (containsName(peer.getName())) throw ModelError("A peer with the same name already exists"); if (containsId(peer.getId())) throw ModelError("A peer with the same id already exists"); _peers.push_back(peer); }
int FSPlaceObject2::lengthInStream(FSOutputStream* aStream) { FSMovieObject::lengthInStream(aStream); aStream->setContext(FSStream::ColorContainsAlpha, 1); length += 3; length += (place == New || place == Replace) ? 2 : 0; length += (containsTransform()) ? transform.lengthInStream(aStream) : 0; length += (containsColorTransform(aStream)) ? colorTransform.lengthInStream(aStream) : 0; length += (containsRatio()) ? 2 : 0; length += (containsName()) ? name.length()+1 : 0; length += (containsClippingDepth()) ? 2 : 0; if (containsClipEvents()) { if (encodedLength > 0) { length += encodedLength; } else { int eventSize = aStream->getContext(FSStream::Version) > 5 ? 4 : 2; length += 2 + eventSize; for (FSVector<FSClipEvent>::iterator i = events.begin(); i != events.end(); ++i) length += (*i).lengthInStream(aStream); length += eventSize; } } aStream->setContext(FSStream::ColorContainsAlpha, 0); return length; }
void FSPlaceObject2::encodeToStream(FSOutputStream* aStream) { aStream->startEncoding(className()); FSMovieObject::encodeToStream(aStream); aStream->setContext(FSStream::ColorContainsAlpha, 1); aStream->write(containsClipEvents() ? 1 : 0, FSStream::UnsignedBit, 1); aStream->write(containsClippingDepth() ? 1 : 0, FSStream::UnsignedBit, 1); aStream->write(containsName() ? 1 : 0, FSStream::UnsignedBit, 1); aStream->write(containsRatio() ? 1 : 0, FSStream::UnsignedBit, 1); aStream->write(containsColorTransform(aStream) ? 1 : 0, FSStream::UnsignedBit, 1); aStream->write(containsTransform() ? 1 : 0, FSStream::UnsignedBit, 1); aStream->write(place, FSStream::UnsignedBit, 2); aStream->write(layer, FSStream::UnsignedWord, 16); if (place == New || place == Replace) aStream->write(identifier, FSStream::UnsignedWord, 16); if (containsTransform()) transform.encodeToStream(aStream); if (containsColorTransform(aStream)) colorTransform.encodeToStream(aStream); if (containsRatio()) aStream->write((int)(ratio*65535.0f), FSStream::UnsignedWord, 16); if (containsName()) { aStream->write((byte*)name.c_str(), name.length()); aStream->write(0, FSStream::UnsignedWord, 8); } if (containsClippingDepth()) aStream->write(depth+1, FSStream::UnsignedWord, 16); if (containsClipEvents()) { if (encodedLength > 0) { aStream->write(encodedEvents, encodedLength); } else { int eventSize = aStream->getContext(FSStream::Version) > 5 ? 32 : 16; int eventMask = 0; aStream->write(0, FSStream::UnsignedWord, 16); for (FSVector<FSClipEvent>::iterator i = events.begin(); i != events.end(); ++i) eventMask += (*i).getEvent(); aStream->write(eventMask, FSStream::UnsignedWord, eventSize); #ifdef _DEBUG aStream->startEncoding("array"); #endif for (FSVector<FSClipEvent>::iterator i = events.begin(); i != events.end(); ++i) (*i).encodeToStream(aStream); aStream->write(0, FSStream::UnsignedWord, eventSize); #ifdef _DEBUG aStream->endEncoding("array"); #endif } } aStream->setContext(FSStream::ColorContainsAlpha, 0); aStream->endEncoding(className()); }