20 if(!file.open(QIODevice::ReadOnly))
31 static constexpr
wchar_t key[] = {
32 L
'@', L
'G', L
'a', L
'w', L
'^', L
'2',
33 L
't', L
'G', L
'Q', L
'6', L
'1', L
'-',
34 L
'Î', L
'Ò', L
'n', L
'i'
61 if((fp = fopen(
qPrintable(input),
"rb")) ==
nullptr)
67 if(fstat(fileno(fp), &st))
74 uchar *src =
new uchar[st.st_size];
77 if(fread(src,
sizeof(uchar), st.st_size, fp) != (
size_t)st.st_size)
85 if(memcmp(src,
"krc1", 4) != 0)
94 for(
int i = 0; i < st.st_size; ++i)
96 src[i] = (uchar)(src[i] ^
key[i % 16]);
105 if(!output.isEmpty())
108 if(file.open(QIODevice::WriteOnly))
110 QTextStream outstream(&file);
111 #if TTK_QT_VERSION_CHECK(6,0,0)
112 outstream.setEncoding(QStringConverter::Utf8);
114 outstream.setCodec(
"UTF-8");
132 c1 = (c1 >=
'A' && c1 <=
'Z') ? (c1 | 0x20) : c1;
133 c2 = (c2 >=
'A' && c2 <=
'Z') ? (c2 | 0x20) : c2;
196 for(
int i = 0; i < lrclen; ++i)
207 len = (strchr((
char*)&lrc[i],
']') - (
char*)&lrc[i]) + 1;
208 for(
int j = 0; j < len; ++j)
210 if(lrc[i + j] ==
':')
214 while(lrc[++i] !=
'\n' && i < lrclen)
223 for(
int j = 0; j < len; ++j)
226 if(lrc[i + j] ==
',')
230 ms = atoi((
char*)&lrc[i + 1]);
233 for(j = 0; j < 10; ++j)
249 else if(top == 1 && lrc[i] ==
'>')
260 if(!file.open(QIODevice::ReadOnly))
279 if(regx.
match(text) != -1)
296 if(!file.open(QIODevice::ReadOnly))
304 const QString &
data = QString::fromUtf8(
m_data);
319 if(!file.open(QIODevice::ReadOnly))
327 const QString &
data = QString::fromUtf8(
m_data);
332 if(text.startsWith(
"{"))
338 if(regx.
match(text) != -1)
#define TTKStaticCast(x, y)
QString captured(int index) const
virtual bool decode(const QString &input) overridefinal
The class of the ttk xml interface.
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
const QByteArray & data() const noexcept
QString readAttributeByTagName(const QString &node, const QString &attrName="value") const
virtual bool decode(const QString &input) overridefinal
int isfilter(const char *tok)
static constexpr wchar_t key[]
bool fromByteArray(const QByteArray &data)
virtual bool decode(const QString &input) overridefinal
The class of the base lrc interface.
#define QtNamespace(p)
Qt use namespace.
void createLrc(uchar *lrc, int lrclen)
virtual bool decode(const QString &input) overridefinal
int decompression(uchar *src, size_t srcsize, size_t *dstsize)
virtual bool decode(const QString &input) overridefinal
The class of the regular expression.
static QString toString(qint64 time, const QString &format) noexcept
int match(const QString &str, int pos=0)
#define TTK_ERROR_STREAM(msg)
int sncasecmp(const char *s1, const char *s2, size_t n)