Rev | Line | |
---|
[488] | 1 | #ifndef AMLTOOLS_SEEN |
---|
| 2 | #define AMLTOOLS_SEEN |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | #include <iostream> |
---|
| 6 | #include <string> |
---|
| 7 | |
---|
| 8 | #include "UAP/UAPNode.hpp" |
---|
| 9 | using namespace std; |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | class AMLtools |
---|
| 13 | { |
---|
| 14 | public: |
---|
| 15 | |
---|
| 16 | static bool readAMLParameterAttribut(UAPNode* parametersNode, string parameterName, string attributName, double& resultat) { |
---|
| 17 | if ( !parametersNode ) return false; |
---|
| 18 | UAPNode* parametre = parametersNode->getChildByName(parameterName); |
---|
| 19 | if ( !parametre ) return false; |
---|
| 20 | UAPAttribute* att = parametre->getAttribute(attributName); |
---|
| 21 | if ( att ) { |
---|
| 22 | att->getDouble( resultat); |
---|
| 23 | return true; |
---|
| 24 | } else return false; |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | static bool readAMLParameterAttribut(UAPNode* parametersNode, string parameterName, string attributName, int& resultat) { |
---|
| 28 | if ( !parametersNode ) return false; |
---|
| 29 | UAPNode* parametre = parametersNode->getChildByName(parameterName); |
---|
| 30 | if ( !parametre ) return false; |
---|
| 31 | UAPAttribute* att = parametre->getAttribute(attributName); |
---|
| 32 | if ( att ) { |
---|
| 33 | att->getInt( resultat); |
---|
| 34 | return true; |
---|
| 35 | } else return false; |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | static bool readAMLParameterAttribut(UAPNode* parametersNode, string parameterName, string attributName, string& resultat) { |
---|
| 39 | if ( !parametersNode ) return false; |
---|
| 40 | UAPNode* parametre = parametersNode->getChildByName(parameterName); |
---|
| 41 | if ( !parametre ) return false; |
---|
| 42 | UAPAttribute* att = parametre->getAttribute(attributName); |
---|
| 43 | if ( att ) { |
---|
| 44 | resultat = att->getValue(); |
---|
| 45 | return true; |
---|
| 46 | } else return false; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | }; |
---|
| 51 | |
---|
| 52 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.