30 data.assign(d, size, doCopy);
38 return data.checkSize(offset);
123 const unsigned char *p=
data.getData(it.
i);
124 const unsigned char *end=p+len-it.
i;
142 const unsigned char *p=
data.getData(it.
i);
143 const unsigned char *end=p+len-it.
i;
145 for (
int u=0; u<arrayLength;u++)
171 const unsigned char *p=
data.getData();
194 for (
int i=0;i<
length;i++)
205 for (
int i=0;i<
length;i++)
216 for (
int i=0;i<
length;i++)
224 if (len < 0 || len > 4095)
225 return strdup(
"text error");
226 char *
data=
new char(len+1);
235 if (len < 0 || len >= size) {
236 strncpy(buffer,
"text error", size);
244char *
String::getText(
char *buffer,
char *shortVersion,
int sizeBuffer,
int sizeShortVersion) {
246 if (len < 0 || len >= sizeBuffer) {
247 strncpy(buffer,
"text error", sizeBuffer);
248 buffer[sizeBuffer-1] = 0;
252 decodeText(buffer, shortVersion, sizeBuffer, sizeShortVersion);
291#define SingleByteLimit 0x0B
312#define NumEntries(Table) (sizeof(Table) / sizeof(char *))
331 if (cd != (iconv_t)-1) {
349 size_t la = strlen(a);
350 size_t lb =
sizeof(b);
352 if (cd != (iconv_t)-1) {
353 if (iconv(cd, &pa, &la, &pb, &lb) !=
size_t(-1)) {
365 const char *cs =
"ISO6937";
372 *isSingleByte =
false;
375 unsigned int tag = buffer[0];
380 tag = (buffer[1] << 8) | buffer[2];
385 *isSingleByte =
true;
404#define MT(s, m, v) ((*(s) & (m)) == (v))
405 if (
MT(s, 0xE0, 0xC0) &&
MT(s + 1, 0xC0, 0x80))
407 if (
MT(s, 0xF0, 0xE0) &&
MT(s + 1, 0xC0, 0x80) &&
MT(s + 2, 0xC0, 0x80))
409 if (
MT(s, 0xF8, 0xF0) &&
MT(s + 1, 0xC0, 0x80) &&
MT(s + 2, 0xC0, 0x80) &&
MT(s + 3, 0xC0, 0x80))
416 bool converted =
false;
420 if (cd != (iconv_t)-1) {
421 char *fromPtr = (
char *)from;
422 while (fromLength > 0 && toLength > 1) {
423 if (iconv(cd, &fromPtr, &fromLength, &to, &toLength) ==
size_t(-1)) {
424 if (errno == EILSEQ) {
441 size_t len = fromLength;
444 strncpy(to, from, len);
449 size_t len = strlen(to);
453 unsigned char *p = (
unsigned char *)to;
454 if (l == 2 && *p == 0xC2)
458 case 0x8A: *to =
'\n';
break;
459 case 0xA0: *to =
' ';
break;
460 default: Move =
false;
462 if (l == 2 && Move) {
463 memmove(p, p + 1, len - 1);
471 return strlen(result);
476 const unsigned char *from=
data.getData(0);
487 strncpy(buffer, (
const char *)from, len);
499 *shortVersion =
'\0';
508 unsigned char *p = (
unsigned char *)to;
509 if (l == 2 && *p == 0xC2)
511 if (*p == 0x86 || *p == 0x87) {
512 IsShortName += (*p == 0x86) ? 1 : -1;
513 memmove(to, to + l, len - l + 1);
517 if (l && IsShortName) {
518 if (l < sizeShortVersion) {
519 for (
int i = 0; i < l; i++)
520 *shortVersion++ = to[i];
521 sizeShortVersion -= l;
527 *shortVersion =
'\0';
714 if (!returnUnimplemetedDescriptor)
753 if (!returnUnimplemetedDescriptor)
774 if (!returnUnimplemetedDescriptor)
const unsigned char * getData() const
bool Add(GroupDescriptor *d)
bool deleteOnDesctruction
DescriptorGroup(bool deleteOnDesctruction=true)
int getNumberOfDescriptors()
DescriptorTagDomain domain
Descriptor * getNext(Iterator &it)
Descriptor * createDescriptor(int &i, bool returnUnimplemetedDescriptor)
DescriptorTag getDescriptorTag() const
static Descriptor * getDescriptor(CharArray d, DescriptorTagDomain domain, bool returnUnimplemetedDescriptor)
virtual int getLength() override
virtual int getLastDescriptorNumber()=0
virtual int getDescriptorNumber()=0
int getTableIdExtension() const
bool getCurrentNextIndicator() const
int getSectionNumber() const
int getLastSectionNumber() const
int getVersionNumber() const
void setData(const unsigned char *data, int size, bool doCopy=true)
bool checkSize(int offset)
TableId getTableId() const
virtual int getLength() override
void decodeText(char *buffer, int size, const char **fromCode=NULL)
virtual int getLength() override
static const char * CharacterTables2[]
static int Utf8CharLen(const char *s)
const char * getCharacterTable(const unsigned char *&buffer, int &length, bool *isSingleByte)
bool SetSystemCharacterTable(const char *CharacterTable)
size_t convertCharacterTable(const char *from, size_t fromLength, char *to, size_t toLength, const char *fromCode)
bool SystemCharacterTableIsSingleByte
bool systemCharacterTableIsSingleByte(void)
@ AudioStreamDescriptorTag
@ ECMRepetitionRateDescriptorTag
@ MHP_PrefetchDescriptorTag
@ MHP_SimpleApplicationLocationDescriptorTag
@ StreamIdentifierDescriptorTag
@ VideoWindowDescriptorTag
@ MultiplexBufferUtilizationDescriptorTag
@ RelatedContentDescriptorTag
@ MultilingualComponentDescriptorTag
@ NVODReferenceDescriptorTag
@ EnhancedAC3DescriptorTag
@ ServiceMoveDescriptorTag
@ PrivateDataSpecifierDescriptorTag
@ ScramblingDescriptorTag
@ PartialTransportStreamDescriptorTag
@ CountryAvailabilityDescriptorTag
@ CarouselIdentifierDescriptorTag
@ DataBroadcastDescriptorTag
@ ExtendedEventDescriptorTag
@ VBITeletextDescriptorTag
@ S2SatelliteDeliverySystemDescriptorTag
@ MHP_DVBHTMLApplicationDescriptorTag
@ CableDeliverySystemDescriptorTag
@ ShortEventDescriptorTag
@ PrivateDataIndicatorDescriptorTag
@ ServiceAvailabilityDescriptorTag
@ MaximumBitrateDescriptorTag
@ CaIdentifierDescriptorTag
@ TransportStreamDescriptorTag
@ HdSimulcastLogicalChannelDescriptorTag
@ MHP_DelegatedApplicationDescriptorTag
@ TimeShiftedServiceDescriptorTag
@ ServiceIdentifierDescriptorTag
@ MultilingualNetworkNameDescriptorTag
@ MHP_ApplicationIconsDescriptorTag
@ ShortSmoothingBufferDescriptorTag
@ PremiereContentTransmissionDescriptorTag
@ DataStreamAlignmentDescriptorTag
@ LocalTimeOffsetDescriptorTag
@ TargetBackgroundGridDescriptorTag
@ MultilingualServiceNameDescriptorTag
@ MHP_ExternalApplicationAuthorisationDescriptorTag
@ MHP_TransportProtocolDescriptorTag
@ MHP_DVBHTMLApplicationBoundaryDescriptorTag
@ VideoStreamDescriptorTag
@ SubtitlingDescriptorTag
@ ISO639LanguageDescriptorTag
@ DefaultAuthorityDescriptorTag
@ MHP_ApplicationStorageDescriptorTag
@ AncillaryDataDescriptorTag
@ MHP_DVBJApplicationLocationDescriptorTag
@ TimeSliceFecIdentifierDescriptorTag
@ MultilingualBouquetNameDescriptorTag
@ SystemClockDescriptorTag
@ ServiceListDescriptorTag
@ MHP_IPv4RoutingDescriptorTag
@ MHP_IPv6RoutingDescriptorTag
@ ParentalRatingDescriptorTag
@ DataBroadcastIdDescriptorTag
@ NetworkNameDescriptorTag
@ RegistrationDescriptorTag
@ SatelliteDeliverySystemDescriptorTag
@ CellFrequencyLinkDescriptorTag
@ SmoothingBufferDescriptorTag
@ MHP_DVBJApplicationDescriptorTag
@ AdaptationFieldDataDescriptorTag
@ MHP_DVBHTMLApplicationLocationDescriptorTag
@ MHP_ApplicationDescriptorTag
@ BouquetNameDescriptorTag
@ FrequencyListDescriptorTag
@ ApplicationSignallingDescriptorTag
@ TerrestrialDeliverySystemDescriptorTag
@ TimeShiftedEventDescriptorTag
@ LogicalChannelDescriptorTag
@ AnnouncementSupportDescriptorTag
@ MHP_ApplicationNameDescriptorTag
@ ContentIdentifierDescriptorTag
static char * SystemCharacterTable
static char * OverrideCharacterTable
bool SetOverrideCharacterTable(const char *CharacterTable)
static const char * CharacterTables1[]
#define NumEntries(Table)