summaryrefslogtreecommitdiffstats
path: root/src/devices/pic/xml/pic_xml_to_data.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-05-06 18:26:24 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-05-07 11:02:46 +0900
commit014e4b95648f2b8e7deb57acb0cdd8cefc363477 (patch)
tree02ced501daff512fed5126427f57eca6c2ef3630 /src/devices/pic/xml/pic_xml_to_data.cpp
parentf2e2d9a5271aa9cfd966592d50f60d5b5bf550f4 (diff)
downloadpiklab-014e4b95.tar.gz
piklab-014e4b95.zip
Allow generation of build time data files in out-of-source builds. Also fix generation of data file for devices/mem24 subfolder
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit ac3f0014232619edc41865f6e42e6510bdd8acc6)
Diffstat (limited to 'src/devices/pic/xml/pic_xml_to_data.cpp')
-rw-r--r--src/devices/pic/xml/pic_xml_to_data.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/devices/pic/xml/pic_xml_to_data.cpp b/src/devices/pic/xml/pic_xml_to_data.cpp
index 7cb573e..2419b46 100644
--- a/src/devices/pic/xml/pic_xml_to_data.cpp
+++ b/src/devices/pic/xml/pic_xml_to_data.cpp
@@ -6,6 +6,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
+#include <tqdir.h>
#include <tqfile.h>
#include <tqregexp.h>
@@ -18,6 +19,9 @@ namespace Pic
{
class XmlToData : public Device::XmlToData<Data>
{
+public:
+ XmlToData(const TQString &folder) : Device::XmlToData<Data>(folder) {}
+
private:
virtual TQString namespaceName() const { return "Pic"; }
@@ -673,8 +677,13 @@ void processRegistersFile(const TQString &filename, TQStringList &devices)
void processRegisters()
{
TQStringList devices;
- processRegistersFile("registers/registers.xml", devices);
- processRegistersFile("registers/registers_missing.xml", devices);
+ TQDir xmlFilesDir;
+ if (!xmlFolder.isEmpty())
+ {
+ xmlFilesDir.setPath(xmlFolder + "/registers");
+ }
+ processRegistersFile(xmlFilesDir.absFilePath("registers.xml"), devices);
+ processRegistersFile(xmlFilesDir.absFilePath("registers_missing.xml"), devices);
// check if we miss any register description
TQMap<TQString, Device::Data *>::const_iterator it = _map.begin();