summaryrefslogtreecommitdiffstats
path: root/src/xml_to_data
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:33:27 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-15 15:33:27 -0600
commit9d6927a7d6a543332f828bffedf65eecf6774c6d (patch)
tree9f8210096908fddb7d266b477152021c45fa1a00 /src/xml_to_data
parent3534213800bd8d151759df307755f2bbd592dfa1 (diff)
downloadpiklab-9d6927a7d6a543332f828bffedf65eecf6774c6d.tar.gz
piklab-9d6927a7d6a543332f828bffedf65eecf6774c6d.zip
Rename a number of old tq methods that are no longer tq specific
Diffstat (limited to 'src/xml_to_data')
-rw-r--r--src/xml_to_data/device_xml_to_data.cpp42
-rw-r--r--src/xml_to_data/device_xml_to_data.h2
-rw-r--r--src/xml_to_data/prog_xml_to_data.h12
-rw-r--r--src/xml_to_data/xml_to_data.cpp8
4 files changed, 32 insertions, 32 deletions
diff --git a/src/xml_to_data/device_xml_to_data.cpp b/src/xml_to_data/device_xml_to_data.cpp
index c1d41ac..c0861d4 100644
--- a/src/xml_to_data/device_xml_to_data.cpp
+++ b/src/xml_to_data/device_xml_to_data.cpp
@@ -10,7 +10,7 @@
#include <tqdir.h>
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include <tqregexp.h>
bool Device::XmlToDataBase::getFrequencyRange(OperatingCondition oc, Special special, TQDomElement element)
@@ -84,27 +84,27 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
{
TQString name = device.attribute("name").upper();
if ( name.isEmpty() ) qFatal("Device has no name");
- if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").tqarg(name));
+ if ( _map.contains(name) ) qFatal(TQString("Device \"%1\" already defined").arg(name));
_data = createData();
_map[name] = _data;
_data->_name = name;
_data->_alternatives = TQStringList::split(' ', device.attribute("alternative"));
if ( _data->_alternatives.count() ) _alternatives[name] = _data->_alternatives;
- _data->_status = tqStatus::fromKey(device.attribute("status"));
+ _data->_status = Status::fromKey(device.attribute("status"));
switch (_data->_status.type()) {
- case tqStatus::Nb_Types:
+ case Status::Nb_Types:
qFatal("Unrecognized or absent device status");
break;
- case tqStatus::Future:
+ case Status::Future:
if ( _data->_alternatives.count() ) qFatal("Future device has alternative");
break;
- case tqStatus::NotRecommended:
- case tqStatus::Mature:
+ case Status::NotRecommended:
+ case Status::Mature:
if ( _data->_alternatives.count()==0 ) warning("Not-recommended/mature device has no alternative");
break;
- case tqStatus::InProduction:
- case tqStatus::EOL:
- case tqStatus::Unknown: break;
+ case Status::InProduction:
+ case Status::EOL:
+ case Status::Unknown: break;
}
// document
@@ -119,26 +119,26 @@ void Device::XmlToDataBase::processDevice(TQDomElement device)
_data->_documents.datasheet = documents.attribute("datasheet");
TQRegExp rexp("\\d{5}");
if ( _data->_documents.datasheet=="?" ) warning("No datasheet specified");
- if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").tqarg(_data->_documents.datasheet));
+ if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed datasheet \"%1\" (5 digits)").arg(_data->_documents.datasheet));
_data->_documents.progsheet = documents.attribute("progsheet");
if ( _data->_documents.progsheet=="?" ) warning("No progsheet specified");
- if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").tqarg(_data->_documents.progsheet));
+ if ( !rexp.exactMatch(_data->_documents.datasheet) ) qFatal(TQString("Malformed progsheet \"%1\" (5 digits)").arg(_data->_documents.progsheet));
_data->_documents.erratas = TQStringList::split(" ", documents.attribute("erratas"));
for (uint i=0; i<uint(_data->_documents.erratas.count()); i++) {
TQString errata = _data->_documents.erratas[i];
if ( !rexp.exactMatch(errata) ) {
TQRegExp rexp2("\\d{5}e\\d");
if ( !rexp2.exactMatch(errata) && !errata.startsWith("er") && errata.mid(2)!=_data->_name.lower() )
- qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").tqarg(errata));
+ qFatal(TQString("Malformed erratas \"%1\" (5 digits or 5 digits + e + 1 digit or \"er\" + name)").arg(errata));
}
}
}
if ( _data->_documents.webpage=="?" ) warning("No webpage specified");
else {
TQRegExp rexp("\\d{6}");
- if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").tqarg(_data->_documents.webpage));
+ if ( !rexp.exactMatch(_data->_documents.webpage) ) qFatal(TQString("Malformed webpage \"%1\" (6 digits)").arg(_data->_documents.webpage));
if ( _documents.contains(_data->_documents.webpage) )
- qFatal(TQString("webpage duplicated (already used for %1)").tqarg(_documents[_data->_documents.webpage]));
+ qFatal(TQString("webpage duplicated (already used for %1)").arg(_documents[_data->_documents.webpage]));
_documents[_data->_documents.webpage] = name;
}
@@ -194,21 +194,21 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
for (; Package::TYPE_DATA[i].name; i++) {
if ( types[k]!=Package::TYPE_DATA[i].name ) continue;
for (uint j=0; j<uint(package.types.count()); j++)
- if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").tqarg(types[k]));
+ if ( package.types[j]==i ) qFatal(TQString("Duplicated package type %1").arg(types[k]));
uint j = 0;
for (; j<Package::MAX_NB; j++)
if ( nb==Package::TYPE_DATA[i].nbPins[j] ) break;
- if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").tqarg(types[k]).tqarg(nb).tqarg(Package::TYPE_DATA[i].nbPins[0]));
+ if ( j==Package::MAX_NB ) qFatal(TQString("Package %1 does not have the correct number of pins %2 (%3)").arg(types[k]).arg(nb).arg(Package::TYPE_DATA[i].nbPins[0]));
package.types.append(i);
break;
}
- if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").tqarg(types[k]));
+ if ( Package::TYPE_DATA[i].name==0 ) qFatal(TQString("Unknown package type \"%1\"").arg(types[k]));
}
// pins
TQString name = Package::TYPE_DATA[package.types[0]].name;
if ( name=="sot23" ) {
if ( package.types.count()!=1 ) qFatal("SOT23 should be a specific package");
- } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").tqarg(name));
+ } else if ( (nb%2)!=0 ) qFatal(TQString("\"nb_pins\" should be even for package \"%1\"").arg(name));
uint have_pins = false;
TQMemArray<bool> found(nb);
found.fill(false);
@@ -234,7 +234,7 @@ Device::Package Device::XmlToDataBase::processPackage(TQDomElement element)
child = child.nextSibling();
}
if ( !have_pins ) ;//warning("Pins not specified"); // #### REMOVE ME !!
- else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").tqarg(i+1));
+ else for (uint i=0; i<nb; i++) if ( !found[i] ) qFatal(TQString("Pin #%1 not specified").arg(i+1));
return package;
}
@@ -255,6 +255,6 @@ void Device::XmlToDataBase::parse()
for (; ait!=_alternatives.end(); ++ait) {
TQStringList::const_iterator lit = ait.data().begin();
for (; lit!=ait.data().end(); ++lit)
- if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").tqarg((*lit)).tqarg(ait.key()));
+ if ( !_map.contains(*lit) ) qFatal(TQString("Unknown alternative %1 for device %2").arg((*lit)).arg(ait.key()));
}
}
diff --git a/src/xml_to_data/device_xml_to_data.h b/src/xml_to_data/device_xml_to_data.h
index 36b8824..9a065a0 100644
--- a/src/xml_to_data/device_xml_to_data.h
+++ b/src/xml_to_data/device_xml_to_data.h
@@ -11,7 +11,7 @@
#include <tqmap.h>
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include "common/common/misc.h"
#include "common/common/streamer.h"
diff --git a/src/xml_to_data/prog_xml_to_data.h b/src/xml_to_data/prog_xml_to_data.h
index e45e6e1..b9f6a5f 100644
--- a/src/xml_to_data/prog_xml_to_data.h
+++ b/src/xml_to_data/prog_xml_to_data.h
@@ -10,7 +10,7 @@
#define PROG_XML_TO_DATA_H
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include <tqmap.h>
#include "xml_to_data.h"
@@ -68,12 +68,12 @@ void ExtXmlToData<Data>::parseDevice(TQDomElement element)
{
if ( element.nodeName()!="device" ) qFatal("Root node child should be named \"device\"");
_current = element.attribute("name").upper();
- if ( Device::lister().data(_current)==0 ) qFatal(TQString("Device name \"%1\" unknown").tqarg(_current));
- if ( _map.contains(_current) ) qFatal(TQString("Device \"%1\" already parsed").tqarg(_current));
+ if ( Device::lister().data(_current)==0 ) qFatal(TQString("Device name \"%1\" unknown").arg(_current));
+ if ( _map.contains(_current) ) qFatal(TQString("Device \"%1\" already parsed").arg(_current));
PData data;
if ( hasFamilies() ) {
TQString family = element.attribute("family");
- if ( family.isEmpty() ) qFatal(TQString("Family is empty").tqarg(family));
+ if ( family.isEmpty() ) qFatal(TQString("Family is empty").arg(family));
if ( _families.find(family)==_families.end() ) _families.append(family);
data.family = familyIndex(family);
}
@@ -88,7 +88,7 @@ void ExtXmlToData<Data>::parse()
TQDomDocument doc = parseFile(_basename + ".xml");
TQDomElement root = doc.documentElement();
if ( root.nodeName()!="type" ) qFatal("Root node should be \"type\"");
- if ( root.attribute("name")!=_basename ) qFatal(TQString("Root node name is not \"%1\"").tqarg(_basename));
+ if ( root.attribute("name")!=_basename ) qFatal(TQString("Root node name is not \"%1\"").arg(_basename));
TQDomNode child = root.firstChild();
while ( !child.isNull() ) {
if ( child.isComment() ) qDebug("comment: %s", child.toComment().data().latin1());
@@ -105,7 +105,7 @@ void ExtXmlToData<Data>::output()
{
// write .cpp file
TQFile file(_basename + "_data.cpp");
- if ( !file.open(IO_WriteOnly) ) qFatal(TQString("Cannot open output file \"%1\"").tqarg(file.name()));
+ if ( !file.open(IO_WriteOnly) ) qFatal(TQString("Cannot open output file \"%1\"").arg(file.name()));
TQTextStream s(&file);
s << "// #### Do not edit: this file is autogenerated !!!" << endl << endl;
s << "#include \"devices/list/device_list.h\"" << endl;
diff --git a/src/xml_to_data/xml_to_data.cpp b/src/xml_to_data/xml_to_data.cpp
index 8e14d81..ee6a204 100644
--- a/src/xml_to_data/xml_to_data.cpp
+++ b/src/xml_to_data/xml_to_data.cpp
@@ -9,7 +9,7 @@
#include "xml_to_data.h"
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
TQDomElement XmlToData::findUniqueElement(TQDomElement parent, const TQString &tag,
const TQString &attribute, const TQString &value) const
@@ -19,7 +19,7 @@ TQDomElement XmlToData::findUniqueElement(TQDomElement parent, const TQString &t
while ( !child.isNull() ) {
if ( child.nodeName()==tag && child.isElement()
&& (attribute.isEmpty() || child.toElement().attribute(attribute)==value) ) {
- if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").tqarg(tag).tqarg(value));
+ if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").arg(tag).arg(value));
element = child.toElement();
}
child = child.nextSibling();
@@ -34,7 +34,7 @@ void XmlToData::checkTagNames(TQDomElement element, const TQString &tag,
for (uint i=0; i<uint(list.count()); i++) {
if ( !list.item(i).isElement() ) continue;
TQString name = list.item(i).toElement().attribute("name");
- if ( names.find(name)==names.end() ) qFatal(TQString("Illegal name %1 for %2 element").tqarg(name).tqarg(tag));
+ if ( names.find(name)==names.end() ) qFatal(TQString("Illegal name %1 for %2 element").arg(name).arg(tag));
}
}
@@ -47,7 +47,7 @@ TQDomDocument XmlToData::parseFile(const TQString &filename) const
TQString error;
int errorLine, errorColumn;
if ( !doc.setContent(&file, false, &error, &errorLine, &errorColumn) )
- qFatal(TQString("Error parsing XML file (%1 at line %2, column %3)").tqarg(error).tqarg(errorLine).tqarg(errorColumn));
+ qFatal(TQString("Error parsing XML file (%1 at line %2, column %3)").arg(error).arg(errorLine).arg(errorColumn));
return doc;
}