summaryrefslogtreecommitdiffstats
path: root/poxml/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'poxml/parser.cpp')
-rw-r--r--poxml/parser.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/poxml/parser.cpp b/poxml/parser.cpp
index be06d80a..fc19468d 100644
--- a/poxml/parser.cpp
+++ b/poxml/parser.cpp
@@ -173,7 +173,7 @@ bool StructureParser::isClosure(const TQString &message)
bool StructureParser::closureTag(const TQString& message, const TQString &tag)
{
#ifdef POXML_DEBUG
- qDebug("closureTag %s %s", message.latin1(), tag.latin1());
+ tqDebug("closureTag %s %s", message.latin1(), tag.latin1());
#endif
int inside = 0;
@@ -182,10 +182,10 @@ bool StructureParser::closureTag(const TQString& message, const TQString &tag)
{
int nextclose = message.find(TQRegExp(TQString::fromLatin1("</%1[\\s>]").arg(tag)), index);
int nextstart = message.find(TQRegExp(TQString::fromLatin1("<%1[>\\s]").arg(tag)), index);
- // qDebug("finding %d %d %d %d", nextstart, nextclose, index, inside);
+ // tqDebug("finding %d %d %d %d", nextstart, nextclose, index, inside);
if (nextclose == -1) {
#ifdef POXML_DEBUG
- qDebug("ending on no close anymore %d %d %d %d", (!inside && index >= message.length()), inside, index, message.length());
+ tqDebug("ending on no close anymore %d %d %d %d", (!inside && index >= message.length()), inside, index, message.length());
#endif
return !inside && index >= message.length();
}
@@ -206,7 +206,7 @@ bool StructureParser::closureTag(const TQString& message, const TQString &tag)
index++;
if (!inside) {
#ifdef POXML_DEBUG
- qDebug("ending on exit %d", index >= message.length());
+ tqDebug("ending on exit %d", index >= message.length());
#endif
return index >= message.length();
}
@@ -260,7 +260,7 @@ void StructureParser::descape(TQString &message)
bool StructureParser::formatMessage(MsgBlock &msg) const
{
#ifdef POXML_DEBUG
- qDebug("formatMessage %s", msg.msgid.latin1());
+ tqDebug("formatMessage %s", msg.msgid.latin1());
#endif
int offset = 0;
@@ -282,7 +282,7 @@ bool StructureParser::formatMessage(MsgBlock &msg) const
!msg.msgid.at( slen + 1 ).isLetterOrNumber() )
{
#ifdef POXML_DEBUG
- qDebug("removing single tag %s", singletags[index]);
+ tqDebug("removing single tag %s", singletags[index]);
#endif
int strindex = strlen(singletags[index]) + 1;
while (msg.msgid.at(strindex) != '>')
@@ -321,7 +321,7 @@ bool StructureParser::formatMessage(MsgBlock &msg) const
while (msg.msgid.at(endindex) != '<' && msg.msgid.at(endindex + 1) != '/')
endindex--;
#ifdef POXML_DEBUG
- qDebug("endIndex %d", endindex);
+ tqDebug("endIndex %d", endindex);
#endif
strindex = endindex;
TQString orig = msg.msgid;
@@ -349,7 +349,7 @@ bool StructureParser::formatMessage(MsgBlock &msg) const
msg.lines.first().start_line = infos_reg.cap(1).toInt();
msg.lines.first().start_col = infos_reg.cap(2).toInt();
#ifdef POXML_DEBUG
- qDebug("col %s %s %d", attr.latin1(), msg.msgid.latin1(), msg.lines.first().start_col);
+ tqDebug("col %s %s %d", attr.latin1(), msg.msgid.latin1(), msg.lines.first().start_col);
#endif
offset = 0;
@@ -369,7 +369,7 @@ bool StructureParser::formatMessage(MsgBlock &msg) const
}
#ifdef POXML_DEBUG
- qDebug("formatMessage result %s %d %d", msg.msgid.latin1(), changed && recurse, msg.lines.first().start_col);
+ tqDebug("formatMessage result %s %d %d", msg.msgid.latin1(), changed && recurse, msg.lines.first().start_col);
#endif
msg.lines.first().offset += offset;
@@ -392,7 +392,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
TQString message = mb.msgid;
#ifdef POXML_DEBUG
- qDebug("splitMessage %s", message.latin1());
+ tqDebug("splitMessage %s", message.latin1());
#endif
if (message.at(0) == '<') {
@@ -414,7 +414,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
int inside = 1;
while (true) {
#ifdef POXML_DEBUG
- qDebug("inside %s %d", message.mid(strindex, 35).latin1(), inside);
+ tqDebug("inside %s %d", message.mid(strindex, 35).latin1(), inside);
#endif
// the exception for poxml_* attributes is made in the closing tag
@@ -424,7 +424,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
strindex);
#ifdef POXML_DEBUG
- qDebug("index1 %d %d %d", closing_index, starting_index, strindex);
+ tqDebug("index1 %d %d %d", closing_index, starting_index, strindex);
#endif
// when a new start was found, we set the start_index after the next match
@@ -437,7 +437,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
}
#ifdef POXML_DEBUG
- qDebug("index %d %d %d", closing_index, starting_index, strindex);
+ tqDebug("index %d %d %d", closing_index, starting_index, strindex);
#endif
assert(closing_index != -1);
@@ -448,7 +448,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
if (starting_index == -1) {
strindex = closing_index;
#ifdef POXML_DEBUG
- qDebug("set strindex %d", strindex);
+ tqDebug("set strindex %d", strindex);
#endif
inside--;
if (!inside)
@@ -469,7 +469,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
}
#ifdef POXML_DEBUG
- qDebug("split into %s -AAAAAANNNNNNDDDDDD- %s", message.left(strindex).latin1(), message.mid(strindex).latin1());
+ tqDebug("split into %s -AAAAAANNNNNNDDDDDD- %s", message.left(strindex).latin1(), message.mid(strindex).latin1());
#endif
msg1.msgid = message.left(strindex);
bool leave = formatMessage(msg1);
@@ -487,7 +487,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
}
#ifdef POXML_DEBUG
- qDebug("splited %d-%d(%s) and %d-%d(%s)", msg1.lines.first().end_line,msg1.lines.first().end_col,
+ tqDebug("splited %d-%d(%s) and %d-%d(%s)", msg1.lines.first().end_line,msg1.lines.first().end_col,
msg1.msgid.latin1(),
msg2.lines.first().start_line,msg2.lines.first().start_col, msg2.msgid.latin1());
#endif
@@ -514,7 +514,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
tag = tag.left(tag.find(' '));
}
#ifdef POXML_DEBUG
- qDebug("behind tag %s", tag.latin1());
+ tqDebug("behind tag %s", tag.latin1());
#endif
if (isCuttingTag(tag))
@@ -526,7 +526,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
int inside = 1;
while (true) {
#ifdef POXML_DEBUG
- qDebug("inside %s %d", message.mid(strindex, 35).latin1(), inside);
+ tqDebug("inside %s %d", message.mid(strindex, 35).latin1(), inside);
#endif
int closing_index = message.findRev(TQRegExp(TQString::fromLatin1("</%1[\\s>]").arg(tag)),
@@ -535,7 +535,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
strindex - 1);
#ifdef POXML_DEBUG
- qDebug("index1 %d %d %d", closing_index, starting_index, strindex);
+ tqDebug("index1 %d %d %d", closing_index, starting_index, strindex);
#endif
if (starting_index == -1) {
@@ -558,7 +558,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
#ifdef POXML_DEBUG
- qDebug("split2 into \"%s\" -AAAAAANNNNNNNNNDDDDDDDDDDD- \"%s\"", message.left(strindex).latin1(), message.mid(strindex).latin1());
+ tqDebug("split2 into \"%s\" -AAAAAANNNNNNNNNDDDDDDDDDDD- \"%s\"", message.left(strindex).latin1(), message.mid(strindex).latin1());
#endif
msg1.msgid = message.left(strindex);
@@ -577,7 +577,7 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb)
}
#ifdef POXML_DEBUG
- qDebug("splited %d-%d(%s) and %d-%d(%s)", msg1.lines.first().end_line,msg1.lines.first().end_col,
+ tqDebug("splited %d-%d(%s) and %d-%d(%s)", msg1.lines.first().end_line,msg1.lines.first().end_col,
msg1.msgid.latin1(),
msg2.lines.first().start_line,msg2.lines.first().start_col, msg2.msgid.latin1());
#endif
@@ -597,7 +597,7 @@ bool StructureParser::endElement( const TQString& , const TQString&, const TQStr
{
TQString tname = qName.lower();
- // qDebug("endElement %s - %s %d", tname.latin1(), message.latin1(), inside);
+ // tqDebug("endElement %s - %s %d", tname.latin1(), message.latin1(), inside);
if (inside) {
if (!isSingleTag(qName)) {
@@ -629,7 +629,7 @@ bool StructureParser::endElement( const TQString& , const TQString&, const TQStr
it != messages.end(); ++it)
{
#ifdef POXML_DEBUG
- qDebug("parser '%s' %d '%s' %d:%d", (*it).msgid.latin1(), (*it).lines.first().offset, message.mid((*it).lines.first().offset, 15).latin1(), (*it).lines.first().start_line, (*it).lines.first().start_col);
+ tqDebug("parser '%s' %d '%s' %d:%d", (*it).msgid.latin1(), (*it).lines.first().offset, message.mid((*it).lines.first().offset, 15).latin1(), (*it).lines.first().start_line, (*it).lines.first().start_col);
#endif
// if the remaining text still starts with a tag, the poxml_ info
// is most probably more correct
@@ -752,7 +752,7 @@ void StructureParser::cleanupTags( TQString &contents )
break;
TQString tag = start.cap(1);
TQString cut = start.capturedTexts().last();
- // qDebug("UNCLO %s %d -%s- -%s-", start.cap(0).latin1(), index, tag.latin1(), cut.latin1());
+ // tqDebug("UNCLO %s %d -%s- -%s-", start.cap(0).latin1(), index, tag.latin1(), cut.latin1());
contents.replace(index, start.matchedLength(), TQString("<%1%2>").arg(tag).arg(cut));
}
TQRegExp singletag("<(\\w*)\\s([^><]*)/>");
@@ -779,14 +779,14 @@ void StructureParser::cleanupTags( TQString &contents )
}
#ifdef POXML_DEBUG
- qDebug("final %s", contents.latin1());
+ tqDebug("final %s", contents.latin1());
#endif
}
static bool removeEmptyTag( TQString &contents, const TQString & tag)
{
-// qDebug("cont %s %s", contents.latin1(), tag.latin1());
+// tqDebug("cont %s %s", contents.latin1(), tag.latin1());
TQRegExp empty(TQString("<%1[^>]*>[\\s\n][\\s\n]*</%2\\s*>").arg(tag).arg(tag));
int strindex = 0;
@@ -794,7 +794,7 @@ static bool removeEmptyTag( TQString &contents, const TQString & tag)
strindex = contents.find(empty, strindex);
if (strindex < 0)
break;
- qDebug("found empty tag %s", tag.latin1());
+ tqDebug("found empty tag %s", tag.latin1());
contents.replace(strindex, empty.matchedLength(), " ");
strindex++;
return true;
@@ -985,7 +985,7 @@ MsgList parseXML(const char *filename)
if (found != msgids.end()) {
if (found.data() != (*it).tag) {
#ifdef POXML_DEBUG
- qDebug("same msgid for '%s' and '%s'", found.data().latin1(), (*it).tag.latin1());
+ tqDebug("same msgid for '%s' and '%s'", found.data().latin1(), (*it).tag.latin1());
#endif
changed = true;
TQString msgid = (*it).msgid;