1 # <a name="Package <code>TWiki::Prefs::Parser="></a> Package =TWiki::Prefs::Parser
3 This Prefs-internal class is used to parse \* Set and \* Local statements from arbitrary text, and extract settings from meta objects. It is used by [[TopicPrefs]] to parse preference settings from topics.
5 This class does no validation or duplicate-checking on the settings; it simply returns the recognized settings in the order it sees them in.
9 <li><a href="#Package =TWiki::Prefs::Parser="> Package TWiki::Prefs::Parser</a><ul>
10 <li><a href="#ClassMethod <strong>new</strong> () -> topicpar"> ClassMethod new <tt>() -> topicparserobject</tt></a></li>
11 <li><a href="#ObjectMethod <strong>parseText</strong> ($text,"> ObjectMethod parseText <tt>($text,$prefs)</tt></a></li>
12 <li><a href="#ObjectMethod <strong>parseMeta</strong> ($metaO"> ObjectMethod parseMeta <tt>($metaObject,$prefs)</tt></a></li>
18 ## <a name="ClassMethod <strong>new</strong> () - topicpars"></a> [[ClassMethod]] **new** `() -> topicparserobject`
20 Construct a new parser object.
22 ## <a name="ObjectMethod <strong>parseText</strong> ($text,"></a> [[ObjectMethod]] **parseText** `($text,$prefs)`
24 Parse settings from text and add them to the preferences in $prefs
26 ## <a name="ObjectMethod <strong>parseMeta</strong> ($metaO"></a> [[ObjectMethod]] **parseMeta** `($metaObject,$prefs)`
28 Traverses through all PREFERENCE attributes of the meta object, creating one setting named with $settingPrefPrefix . 'title' for each. It also creates an entry named with the field 'name', which is a cleaned-up, space-removed version of the title.
30 Settings are added to the $prefs passed.