source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Configuration/src/XMLUtils_getAttribute.cpp @ 88

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 838 bytes
Line 
1/*
2 * $Id: XMLUtils_getAttribute.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Configuration/include/XMLUtils.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace configuration {
13
14#undef  FUNCTION
15#define FUNCTION "getAttribute"
16  attribute_t getAttribute(XML_t *             xml,
17                           attributes_t      & attributes,
18                           const attribute_t & name)
19  {
20    // List attribute
21    attributes_t::iterator it = attributes.find(name); 
22   
23    if (it == attributes.end())
24      throw ERRORMORPHEO(FUNCTION,toString(_("Syntax error, node \"%s\" must have attribute \"%s\"\n"),xml->getName().c_str(),name.c_str()));
25 
26    attribute_t str = it->second;
27
28    attributes.erase(it);
29
30    return str;
31  }
32
33}; // end namespace configuration
34}; // end namespace behavioural
35}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.