Commit Graph
76 Commits
Author SHA1 Message Date
Glenn Maynard f588a033a8 avoid ambiguity with template AppendAttr 2006-10-09 05:13:08 +00:00
Glenn Maynard 3cae60d6fd Currently, expression handling in XML is spotting and inconsistent.
Each actor type needs to evaluate attributes; only a few do.  Strings
are handled with the "@foo()" notation.

Instead, after loading an XML file for loading as an actor,
precompile all XML attributes as Lua expressions.

The primary difference to code is:
 - previously, Attr="string" would act as a string if it was being
   read as one.  Now, specify Attr='"string"'.  Attr="@string" is
   a shorthand.  (note that @strings will not be parsed as Lua
   strings, so can not use Lua escape characters)
 - previously, Attr="@func()" would evaluate func(), and the value
   of the attribute would be the return value of the function.  This
   was only supported for a few attributes.  Now, say Attr="func()",
   and this will work for all fields.
 - Attributes of other types are unchanged, except that all attributes
   may be Lua expressions, eg. Width="SCREEN_WIDTH".
 - Attributes names ending with "Command" are special, like metrics.
   Prefix "%" to disable this.

This brings XML handling in line with metric handling.  (This is an intermediary
step; I have another idea that follows from this that should eliminate the annoying
"'foo'"/"@foo".)
2006-10-09 00:49:30 +00:00
Glenn Maynard fc2ddf5d3d unneeded 2006-10-06 06:42:30 +00:00
Glenn Maynard ba82cc8002 m_Value -> base pointer 2006-10-06 06:38:46 +00:00
Glenn Maynard 6808723b85 XNodeValue base class, Copy() 2006-10-06 06:26:53 +00:00
Steve Checkoway 24a147c74b Fix warning. 2006-10-03 03:37:31 +00:00
Glenn Maynard cacef7b54b cause compiler error if trying to use undefined operator= 2006-10-03 02:39:17 +00:00
Glenn Maynard 7988da5c68 remove DateTime binding; at least for now, keep XNode binding to basic types 2006-10-03 00:15:28 +00:00
Glenn Maynard 1a89ddfccd pointer to attributes 2006-10-03 00:07:01 +00:00
Glenn Maynard 30d91df8f4 XML attribute fields and string fields are the same. Use
a type, so we don't duplicate everything for both.
2006-10-02 22:47:16 +00:00
Glenn Maynard 4d2feecc35 fix compile 2006-10-02 22:42:24 +00:00
Glenn Maynard 30d8823a44 allow removing without deleting (detaching) 2006-10-02 06:36:07 +00:00
Glenn Maynard 6db05d676a SetName 2006-10-02 06:34:10 +00:00
Glenn Maynard f0fe542b2f remove bool overload. It's being used instead of the RString one for string constants. 2006-10-02 06:25:28 +00:00
Glenn Maynard 5f0e8a7167 GetName, GetValue 2006-10-02 06:02:54 +00:00
Glenn Maynard 19e7328d78 move XML loading and saving into XmlFileUtil, reducing XNode
to a data structure
2006-10-02 05:53:56 +00:00
Glenn Maynard f8e3807996 fix AppendChild("string", RString) calls bool overload 2006-10-02 05:44:57 +00:00
Steve Checkoway 65007cf941 ctor that takes the name. 2006-10-01 14:46:28 +00:00
Steve Checkoway b22b7972aa Simplify. 2006-10-01 14:24:19 +00:00
Steve Checkoway b7ce93ffad Simplify. 2006-10-01 14:02:24 +00:00
Steve Checkoway f73100705b Simplify. 2006-10-01 13:55:01 +00:00
Steve Checkoway 01cd66bd0f DISP_OPT -> XMLDisplayOptions. 2006-10-01 13:07:20 +00:00
Steve Checkoway 6651be1203 Always true. 2006-10-01 13:00:20 +00:00
Steve Checkoway 08155c351a Simplify. 2006-10-01 12:52:00 +00:00
Steve Checkoway d778966fc6 The existence of an error is signaled by error_string being nonempty. 2006-10-01 12:39:50 +00:00
Steve Checkoway c89900e2c1 Always true. 2006-10-01 12:29:14 +00:00
Steve Checkoway 9f9f61579c Unused. 2006-10-01 12:22:28 +00:00
Steve Checkoway 45a5b01c87 Unused. 2006-10-01 12:16:03 +00:00
Steve Checkoway fbe0626a68 Cleanup. 2006-10-01 12:09:19 +00:00
Glenn Maynard 5d6e7427e0 fix invalid deref 2006-06-08 06:11:32 +00:00
Chris Danford 7dea392550 CString -> RString 2005-12-27 23:43:49 +00:00
Chris Danford 353e0c5b6e break up arch stuff into smaller .cpp files to fix smpackage build and not pull in unnecessary stuff 2005-12-16 04:16:09 +00:00
Chris Danford 100ce95f14 don't pass DISPLAY_OPT as a pointer to avoid NULL pointer deref 2005-11-22 21:14:48 +00:00
Glenn Maynard a2a6dd73d8 cleanup 2005-10-11 11:11:03 +00:00
Glenn Maynard 64d9c29568 Simplify: store attributes in a simple map<CString,CString>, not in an object.
Makes attributes lighter.
2005-10-11 10:24:07 +00:00
Glenn Maynard 489bb9b3ed cleanup 2005-10-11 09:37:18 +00:00
Glenn Maynard fc6e0a2571 Multiple attributes with the same name aren't allowed in XML. (grr, ugly)
Add copy ctor.
2005-10-11 09:35:53 +00:00
Glenn Maynard 1c5ce3bf8b use CString 2005-09-06 18:25:16 +00:00
Glenn Maynard e676f9449d remove unused escaping stuff (don't think this is even part of XML) 2005-09-05 23:22:15 +00:00
Glenn Maynard 852558eb06 replace slow entity parsing code 2005-09-04 23:05:58 +00:00
Glenn Maynard 7c88d5ed88 cleanup 2005-09-04 21:59:00 +00:00
Glenn Maynard 286c008b41 optimize: take CString&, not char*; passing char* causes a CString to be
constructed from it when we use it, which is a waste, since it often comes from
a CString already
cleanup
2005-09-04 05:12:48 +00:00
Glenn Maynard e8182daf16 cleanups 2005-09-03 08:28:43 +00:00
Glenn Maynard eb05db1305 cleanup, optimize 2005-08-26 19:13:08 +00:00
Chris Danford 63eebeb75e add GetXML overload for convenience 2005-06-16 03:08:45 +00:00
Chris Danford ceef12b5cd Have the XML parser warn about the error. Don't make every XML user have their own warning code. 2005-05-29 01:05:23 +00:00
Chris Danford cf698b55a0 clean up XML error handling 2005-02-18 13:05:17 +00:00
Chris Danford 26dc26ff62 fix misspelling 2005-02-18 11:55:34 +00:00
Glenn Maynard 8884936a17 const fix 2005-02-18 03:07:22 +00:00
Glenn Maynard 8ee052516a XNode::LoadFromFile(RageFileBasic) 2005-01-08 19:12:44 +00:00