summaryrefslogtreecommitdiffstats
path: root/src/XMLNode.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-02-27 11:46:29 +0100
committerWillem Jan Palenstijn <wjp@usecode.org>2015-02-27 11:46:29 +0100
commit03a9dd972ada50eedb83386910cecf02fe8d0e35 (patch)
treef764bff6a8109d42445bdd1db622fd739baf5d4a /src/XMLNode.cpp
parent9e2bb413a937aefe57f4fcf343413543ae57258a (diff)
parent169e912d2633cda7ffc234e78afba1b096e122ea (diff)
downloadastra-03a9dd972ada50eedb83386910cecf02fe8d0e35.tar.gz
astra-03a9dd972ada50eedb83386910cecf02fe8d0e35.tar.bz2
astra-03a9dd972ada50eedb83386910cecf02fe8d0e35.tar.xz
astra-03a9dd972ada50eedb83386910cecf02fe8d0e35.zip
Merge pull request #20 from wvaarle/matlab-get-geometry
'get_geometry' functions in the matlab layer
Diffstat (limited to 'src/XMLNode.cpp')
-rw-r--r--src/XMLNode.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/XMLNode.cpp b/src/XMLNode.cpp
index a5b6796..4b2bdf4 100644
--- a/src/XMLNode.cpp
+++ b/src/XMLNode.cpp
@@ -448,13 +448,11 @@ void XMLNode::setContent(float32 _fValue)
// Set content - LIST
void XMLNode::setContent(float32* pfList, int _iSize)
{
- addAttribute("listsize", _iSize);
- for (int i = 0; i < _iSize; i++) {
- XMLNode* item = addChildNode("ListItem");
- item->addAttribute("index", i);
- item->addAttribute("value",pfList[i]);
- delete item;
+ std::string str = (_iSize > 0) ? boost::lexical_cast<std::string>(pfList[0]) : "";
+ for (int i = 1; i < _iSize; i++) {
+ str += "," + boost::lexical_cast<std::string>(pfList[i]);
}
+ setContent(str);
}
//-----------------------------------------------------------------------------