Modules
ADT Database GTK2 GUI IP PiJAX Public Sql Stdio Subversion System Tools Xosd lua v4l2 wx
Recent Changes
Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0
Popular Downloads
Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48
|
Pike Module Reference: module version 1.2, prepared
MODULE Public.Parser.ClearSilver |
Classes CS HDF
|
|
CLASS Public.Parser.ClearSilver.HDF |
Methods child() copy() create() delete_tree() get() get_child() get_hdf() name() next() read() read_file() set() sort() value() write() write_file()
|
-
Method create
void Public.Parser.ClearSilver.HDF()->create()
- Description
Creates a new, empty HDF object. HDF objects are used to store
and manipulate all the data to be rendered by a CS object.
-
Method read_file
void Public.Parser.ClearSilver.HDF()->read_file(string filename)
- Description
Reads and parses a file containing an HDF dataset, and adds it
to the current object.
- Parameter filename
The name of the file containing the HDF dataset.
-
Method write_file
void Public.Parser.ClearSilver.HDF()->write_file(string filename)
- Description
Writes the current HDF dataset out to a file.
- Parameter filename
The name of the file to write the data to. If it exists, the file
will be overwritten.
-
Method get
string Public.Parser.ClearSilver.HDF()->get(string hdfpath)
- Description
Returns the value of hdfpath, or 0 if hdfpath does
not exist.
- Parameter hdfpath
The path to look for the value in dotted form "A.B.C".
-
Method set
void Public.Parser.ClearSilver.HDF()->set(string hdfpath, string value)
- Description
Sets hdfpath to be new_value.
- Parameter hdfpath
The path to set in dotted form "A.B.C".
- Parameter value
The value to set hdfpath to.
-
Method sort
void Public.Parser.ClearSilver.HDF()->sort(function sort_function)
- Description
Sorts an HDF object's data using the supplied function.
- Parameter sort_function
The function used to sort the HDF data. It must accept two strings, and return
1 if the first argument is greater than the second, 0 if they are equal, or -1
if the first argument is less than the second.
-
Method name
string Public.Parser.ClearSilver.HDF()->name()
- Description
Returns the name of the current HDF node. Only the current level
is returned. If this node is A.B.C, obj_name will return "C".
-
Method value
string Public.Parser.ClearSilver.HDF()->value()
- Description
Returns the value of the current HDF node.
-
Method child
object(Public.Parser.ClearSilver.HDF) Public.Parser.ClearSilver.HDF()->child()
- Description
Returns an HDF object representing the child of the current HDF object.
-
Method next
object(Public.Parser.ClearSilver.HDF) Public.Parser.ClearSilver.HDF()->next()
- Description
Returns an HDF object representing the next peer of the current
HDF object.
-
Method get_hdf
object(Public.Parser.ClearSilver.HDF) Public.Parser.ClearSilver.HDF()->get_hdf(string hdfpath)
- Description
Returns an HDF object representing the HDF subtree located at
hdfpath.
- Parameter hdfpath
The path to retrieve in dotted form "A.B.C".
-
Method get_child
object(Public.Parser.ClearSilver.HDF) Public.Parser.ClearSilver.HDF()->get_child(string hdfpath)
- Description
Returns an HDF object representing the child of the HDF path
hdfpath.
- Parameter hdfpath
The path to retrieve the child of, in dotted form "A.B.C".
-
Method delete_tree
void Public.Parser.ClearSilver.HDF()->delete_tree(string hdfpath)
- Description
Recursively delete a node and all its child nodes from the HDF object.
- Parameter hdfpath
The path to the hdf node to delete, in dotted form "A.B.C".
-
Method copy
void Public.Parser.ClearSilver.HDF()->copy(string hdfpath, object(Public.Parser.ClearSilver.HDF) src)
- Description
Copies an HDF object into the current HDF object's tree.
- Parameter hdfpath
The path in the current object's tree to copy the object to, in
dotted form "A.B.C".
- Parameter src
The HDF object to copy into the current objects tree.
-
Method read
void Public.Parser.ClearSilver.HDF()->read(string data)
- Description
Reads and parses a string of HDF data, and adds it to the current
object's HDF tree. Returns 1 on success or 0 on failure.
- Parameter data
The data to read, in either HDF format.
-
Method write
string Public.Parser.ClearSilver.HDF()->write(string|void prefix)
- Description
Returns a string containing the current HDF dataset.
- Parameter prefix
The optional prefix to prepend to the HDF data returned.
|
CLASS Public.Parser.ClearSilver.CS |
Methods create() parse_file() parse_string() render()
|
-
Method create
void Public.Parser.ClearSilver.CS()->create(object(Public.Parser.ClearSilver.HDF) hdf)
- Description
Creates a new CS object. CS objects take HDF data, and clearsilver
templates, and are used to parse and render the output.
- Parameter hdf
The HDF dataset to supply to templates parsed by this object.
-
Method parse_string
void Public.Parser.ClearSilver.CS()->parse_string(string template)
- Description
Parses a string containing a ClearSilver template and adds it
to the current parse tree.
- Parameter template
The string containing the ClearSilver template to be parsed.
-
Method parse_file
void Public.Parser.ClearSilver.CS()->parse_file(string filename)
- Description
Parses a file containing a ClearSilver template and adds it
to the current parse tree.
- Parameter filename
The filename containing the ClearSilver template to be parsed.
-
Method render
string Public.Parser.ClearSilver.CS()->render()
- Description
Does the final parsing of the internal parse tree and returns a
string containing the rendered output.
|
|