2003-06-11
2003-06-11 15:46:41 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
b105b59e9a482b3a5d586ff74a3b925e8156be1c
(23 lines)
(+15/-8)
[
Show
| Annotate
]
Branch: 5.2
add_property() now supports getting an array of nodes.
Rev: server/base_server/prototypes.pike:1.61
6:
#include <module.h>
#include <variables.h>
#include <module_constants.h>
- constant cvs_version="$Id: prototypes.pike,v 1.60 2003/06/02 12:05:31 grubba Exp $";
+ constant cvs_version="$Id: prototypes.pike,v 1.61 2003/06/11 15:46:41 grubba Exp $";
class Variable
{
694: Inside #if constant(Parser.XML.Tree.XMLNSParser)
Parser.XML.Tree.Node get_xml_data()
{
+ if (!sizeof(data)) return 0;
if (xml_data) return xml_data;
// FIXME: Probably ought to check that the content-type for
// the request is text/xml.
1052: Inside #if constant(Parser.XML.Tree.XMLNSParser)
static constant Node = Parser.XML.Tree.Node;
- static mapping(string:string|Node) properties = ([]);
+ static mapping(string:string|array(Node)|Node) properties = ([]);
static multiset(string) descriptions = (<>);
array(Node) get_children()
1067: Inside #if constant(Parser.XML.Tree.XMLNSParser)
prop_node->
replace_children(map(indices(properties),
lambda(string prop_name) {
- string|Node value = properties[prop_name];
+ string|array(Node)|Node value =
+ properties[prop_name];
if (stringp(value)) {
value = Node(Parser.XML.Tree.XML_TEXT,
"", 0, value);
1075: Inside #if constant(Parser.XML.Tree.XMLNSParser)
Node n = Node(Parser.XML.Tree.XML_ELEMENT,
prop_name, ([]), "", prop_name);
if (value) {
+ if (arrayp(value)) {
+ n->replace_children(value);
+ } else {
n->replace_children(({ value }));
}
-
+ }
return n;
}));
if (sizeof(descriptions)) {
1090: Inside #if constant(Parser.XML.Tree.XMLNSParser)
return ::get_children();
}
- void add_property(string prop_name, string|Node value)
+ void add_property(string prop_name, string|array(Node)|Node value)
{
properties[prop_name] = value;
}
1138: Inside #if constant(Parser.XML.Tree.XMLNSParser)
//! @mixed prop_value
//! @type void|int(0..0)
//! Operation performed ok, no value.
- //! @type string|Node
+ //! @type string|array(Node)|Node
//! Property has value @[prop_value].
//! @type mapping(string:mixed)
//! Operation failed as described by the mapping.
//! @endmixed
void add_property(string href, string prop_name,
- void|int(0..0)|string|Node|mapping(string:mixed)
- prop_value)
+ void|int(0..0)|string|array(Node)|Node|
+ mapping(string:mixed) prop_value)
{
array(XMLStatusNode) stat_nodes;
XMLStatusNode stat_node;