ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/lsys/attr.cpp
Revision: 1.1
Committed: Thu Nov 6 14:31:24 2008 UTC (15 years, 5 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Log Message:
*** empty log message ***

File Contents

# Content
1 /*
2 * attribute set management
3 */
4
5 #include "config.h"
6
7 #include "lsys.h"
8 #include "attr.h"
9
10 vec attribute_set::operator ()(const string &attr, const vec &def) const t_err
11 {
12 const_iterator i;
13 if ((i = find (attr)) == end ())
14 return def;
15
16 if (i->second.size () != 3)
17 throw error("attribute '" + attr + "' must have three elements", i->second);
18
19 return vec (eval_expr (i->second.first ()),
20 eval_expr (i->second.second ()),
21 eval_expr (i->second.third ()));
22 }
23