|
SASC
DVBSoftCAM
|
#include <util.h>
Classes | |
| class | Data |
| class | DataForeignData |
| class | DataOwnData |
Public Member Functions | |
| CharArray () | |
| CharArray (const CharArray &source) | |
| CharArray & | operator= (const CharArray &source) |
| ~CharArray () | |
| void | assign (const unsigned char *data, int size, bool doCopy=true) |
| bool | operator== (const char *string) const |
| bool | operator== (const CharArray &other) const |
| CharArray | operator+ (const int offset) const |
| const unsigned char * | getData () const |
| const unsigned char * | getData (int offset) const |
| template<typename T > | |
| const T * | getData () const |
| template<typename T > | |
| const T * | getData (int offset) const |
| template<typename T > | |
| void | setPointerAndOffset (const T *&p, int &offset) const |
| unsigned char | operator[] (const int index) const |
| int | getLength () const |
| u_int16_t | TwoBytes (const int index) const |
| u_int32_t | FourBytes (const int index) const |
| bool | isValid () const |
| bool | checkSize (int offset) |
| void | addOffset (int offset) |
| SI::CharArray::CharArray | ( | const CharArray & | source | ) |
| SI::CharArray::~CharArray | ( | ) |
| void SI::CharArray::addOffset | ( | int | offset | ) | [inline] |
Definition at line 64 of file util.h.
Referenced by SI::StructureLoop< Rating >::getNext(), and SI::StructureLoop< Rating >::getNextAsPointer().
{ off+=offset; }
| void SI::CharArray::assign | ( | const unsigned char * | data, |
| int | size, | ||
| bool | doCopy = true |
||
| ) |
Definition at line 50 of file util.c.
Referenced by SI::Object::setData().
{
//immutable
if (!data_)
data_= doCopy ? (Data*)new DataOwnData() : (Data*)new DataForeignData();
// This method might need to change things in *data_
// Thus it first checks if this is the only pointer to *data_
if (data_->count_ > 1) {
Data* d = doCopy ? (Data*)new DataOwnData() : (Data*)new DataForeignData();
-- data_->count_;
data_ = d;
}
data_->assign(data, size);
}
| bool SI::CharArray::checkSize | ( | int | offset | ) | [inline] |
Definition at line 62 of file util.h.
Referenced by SI::Object::checkSize().
{ return (data_->valid && (data_->valid=(offset>=0 && off+offset < data_->size))); }
| u_int32_t SI::CharArray::FourBytes | ( | const int | index | ) | const [inline] |
Definition at line 59 of file util.h.
Referenced by SI::AIT::Application::getOrganisationId(), and SI::TypeLoop< SixteenBit >::operator[]().
{ return data_->data ? data_->FourBytes(off+index) : 0; }
| const T* SI::CharArray::getData | ( | int | offset | ) | const [inline] |
| const T* SI::CharArray::getData | ( | ) | const [inline] |
| const unsigned char* SI::CharArray::getData | ( | ) | const [inline] |
Definition at line 50 of file util.h.
Referenced by SI::DescriptorLoop::createDescriptor(), SI::String::decodeText(), SI::NumberedSection::getCurrentNextIndicator(), SI::Descriptor::getDescriptor(), SI::Descriptor::getDescriptorTag(), SI::DescriptorLoop::getDescriptorTags(), SI::NumberedSection::getLastSectionNumber(), SI::Descriptor::getLength(), SI::Section::getLength(), SI::DescriptorLoop::getNext(), SI::DescriptorLoop::getNumberOfDescriptors(), SI::NumberedSection::getSectionNumber(), SI::Section::getTableId(), SI::NumberedSection::getTableIdExtension(), SI::NumberedSection::getVersionNumber(), SI::CRCSection::isCRCValid(), SI::RST::RunningInfo::Parse(), SI::TDT::Parse(), SI::PAT::Association::Parse(), SI::MHP_DVBJApplicationDescriptor::ApplicationEntry::Parse(), SI::MHP_ApplicationNameDescriptor::NameEntry::Parse(), SI::MHP_ApplicationDescriptor::Profile::Parse(), SI::ApplicationSignallingDescriptor::ApplicationEntryDescriptor::Parse(), SI::PremiereContentTransmissionDescriptor::StartDayEntry::StartTimeEntry::Parse(), SI::PremiereContentTransmissionDescriptor::StartDayEntry::Parse(), SI::PremiereContentTransmissionDescriptor::Parse(), SI::ISO639LanguageDescriptor::Language::Parse(), SI::LinkageDescriptor::Parse(), SI::LocalTimeOffsetDescriptor::LocalTimeOffset::Parse(), SI::ServiceMoveDescriptor::Parse(), SI::SubtitlingDescriptor::Subtitling::Parse(), SI::PrivateDataSpecifierDescriptor::Parse(), SI::TimeShiftedServiceDescriptor::Parse(), SI::NVODReferenceDescriptor::Service::Parse(), SI::TerrestrialDeliverySystemDescriptor::Parse(), SI::CableDeliverySystemDescriptor::Parse(), SI::SatelliteDeliverySystemDescriptor::Parse(), SI::ServiceListDescriptor::Service::Parse(), SI::CarouselIdentifierDescriptor::Parse(), SI::StreamIdentifierDescriptor::Parse(), SI::CaDescriptor::Parse(), SI::TeletextDescriptor::Teletext::Parse(), SI::ParentalRatingDescriptor::Rating::Parse(), SI::ContentDescriptor::Nibble::Parse(), SI::TimeShiftedEventDescriptor::Parse(), and setPointerAndOffset().
{ return data_->data+off; }
| const unsigned char* SI::CharArray::getData | ( | int | offset | ) | const [inline] |
| int SI::CharArray::getLength | ( | ) | const [inline] |
| bool SI::CharArray::isValid | ( | ) | const [inline] |
| CharArray SI::CharArray::operator+ | ( | const int | offset | ) | const |
| bool SI::CharArray::operator== | ( | const CharArray & | other | ) | const |
Definition at line 71 of file util.c.
References i.
{
if (!data_ || !other.data_)
return !(data_ || other.data_); //true if both empty
if (data_->size != other.data_->size)
return false;
//do _not_ use strcmp! Data is not necessarily null-terminated.
for (int i=0;i<data_->size;i++)
if (data_->data[i] != other.data_->data[i])
return false;
return true;
}
| bool SI::CharArray::operator== | ( | const char * | string | ) | const |
| unsigned char SI::CharArray::operator[] | ( | const int | index | ) | const [inline] |
| void SI::CharArray::setPointerAndOffset | ( | const T *& | p, |
| int & | offset | ||
| ) | const [inline] |
Definition at line 55 of file util.h.
References getData().
Referenced by SI::PremiereCIT::Parse(), SI::AIT::Application::Parse(), SI::AIT::Parse(), SI::RST::Parse(), SI::TOT::Parse(), SI::EIT::Event::Parse(), SI::EIT::Parse(), SI::SDT::Service::Parse(), SI::SDT::Parse(), SI::NIT::TransportStream::Parse(), SI::NIT::Parse(), SI::TSDT::Parse(), SI::PMT::Stream::Parse(), SI::PMT::Parse(), SI::PAT::Parse(), SI::MHP_ApplicationIconsDescriptor::Parse(), SI::MHP_DVBJApplicationLocationDescriptor::Parse(), SI::MHP_TransportProtocolDescriptor::Parse(), SI::MHP_ApplicationDescriptor::Parse(), SI::AncillaryDataDescriptor::Parse(), SI::PDCDescriptor::Parse(), SI::LinkageDescriptor::Parse(), SI::MultilingualServiceNameDescriptor::Name::Parse(), SI::MultilingualComponentDescriptor::Parse(), SI::MultilingualNameDescriptor::Name::Parse(), SI::FrequencyListDescriptor::Parse(), SI::ComponentDescriptor::Parse(), SI::ServiceDescriptor::Parse(), SI::CaDescriptor::Parse(), SI::ExtendedEventDescriptor::Item::Parse(), SI::ExtendedEventDescriptor::Parse(), and SI::ShortEventDescriptor::Parse().
{ p=(T*)getData(offset); offset+=sizeof(T); }
| u_int16_t SI::CharArray::TwoBytes | ( | const int | index | ) | const [inline] |
Definition at line 58 of file util.h.
Referenced by SI::TypeLoop< SixteenBit >::operator[]().
{ return data_->data ? data_->TwoBytes(off+index) : 0; }