From 4a79d82ba62fa4e5be759fa0fc4b20220e8da303 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 14 Jan 2007 13:58:15 +0000 Subject: [PATCH] make attribute strings lowercase with hyphen instead of underscore; this is consistent with their use as XML attributes --- src/Scripting/nasal-props.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Scripting/nasal-props.cxx b/src/Scripting/nasal-props.cxx index 5305f1449..ea6548ade 100644 --- a/src/Scripting/nasal-props.cxx +++ b/src/Scripting/nasal-props.cxx @@ -81,13 +81,13 @@ static naRef f_getAttribute(naContext c, naRef me, int argc, naRef* args) char *a = naStr_data(val); SGPropertyNode::Attribute attr; if(!a) a = ""; - if(!strcmp(a, "READ")) attr = SGPropertyNode::READ; - else if(!strcmp(a, "WRITE")) attr = SGPropertyNode::WRITE; - else if(!strcmp(a, "ARCHIVE")) attr = SGPropertyNode::ARCHIVE; - else if(!strcmp(a, "TRACE_READ")) attr = SGPropertyNode::TRACE_READ; - else if(!strcmp(a, "TRACE_WRITE")) attr = SGPropertyNode::TRACE_WRITE; - else if(!strcmp(a, "USERARCHIVE")) attr = SGPropertyNode::USERARCHIVE; - else if(!strcmp(a, "TIED")) { + if(!strcmp(a, "read")) attr = SGPropertyNode::READ; + else if(!strcmp(a, "write")) attr = SGPropertyNode::WRITE; + else if(!strcmp(a, "archive")) attr = SGPropertyNode::ARCHIVE; + else if(!strcmp(a, "trace-read")) attr = SGPropertyNode::TRACE_READ; + else if(!strcmp(a, "trace-write")) attr = SGPropertyNode::TRACE_WRITE; + else if(!strcmp(a, "userarchive")) attr = SGPropertyNode::USERARCHIVE; + else if(!strcmp(a, "tied")) { return naNum((*node)->isTied()); } else { naRuntimeError(c, "props.getAttribute() with invalid attribute"); @@ -103,12 +103,12 @@ static naRef f_setAttribute(naContext c, naRef me, int argc, naRef* args) char *a = naStr_data(val); SGPropertyNode::Attribute attr; if(!a) a = ""; - if(!strcmp(a, "READ")) attr = SGPropertyNode::READ; - else if(!strcmp(a, "WRITE")) attr = SGPropertyNode::WRITE; - else if(!strcmp(a, "ARCHIVE")) attr = SGPropertyNode::ARCHIVE; - else if(!strcmp(a, "TRACE_READ")) attr = SGPropertyNode::TRACE_READ; - else if(!strcmp(a, "TRACE_WRITE")) attr = SGPropertyNode::TRACE_WRITE; - else if(!strcmp(a, "USERARCHIVE")) attr = SGPropertyNode::USERARCHIVE; + if(!strcmp(a, "read")) attr = SGPropertyNode::READ; + else if(!strcmp(a, "write")) attr = SGPropertyNode::WRITE; + else if(!strcmp(a, "archive")) attr = SGPropertyNode::ARCHIVE; + else if(!strcmp(a, "trace-read")) attr = SGPropertyNode::TRACE_READ; + else if(!strcmp(a, "trace-write")) attr = SGPropertyNode::TRACE_WRITE; + else if(!strcmp(a, "userarchive")) attr = SGPropertyNode::USERARCHIVE; else { naRuntimeError(c, "props.setAttribute() with invalid attribute"); return naNil();