File: Properties.cpp

package info (click to toggle)
sofa-framework 1.0~beta4-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 88,688 kB
  • ctags: 27,205
  • sloc: cpp: 151,126; ansic: 2,387; xml: 581; sh: 417; makefile: 67
file content (51 lines) | stat: -rw-r--r-- 1,732 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 /***************************************************************************
                               Properties.cpp
                             -------------------
    begin             : Wed Aug 8 2001
    copyright         : (C) 2001 TIMC (Emmanuel Promayon, Matthieu Chabanas)
    email             : Emmanuel.Promayon@imag.fr
    Date              : $Date: 2004/05/11 10:04:20 $
    Version           : $Revision: 1.2 $
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
 
#include "Properties.h"

Properties::Properties(const std::string n) { 
    name = n;
    myPM = NULL;
}

Properties::Properties(PhysicalModel * p, const std::string n) { 
    name = n;
    myPM = p;
}


Properties::~Properties() {
} 

void Properties::domToFields(xmlNodePtr node)
{
	xmlAttr * attrs = node->properties;
	while (attrs)
	{
		const xmlChar * pname = attrs->name;
		xmlChar * pval = attrs->children->content;

		if (pname && pval){
			std::pair<std::string, std::string> attr(std::string((char*)pname), std::string((char*)pval));
			fields.insert(attr);
		}

		attrs = attrs->next;
	}
}