CLASS _OT4XB_EXPANDO_ METHOD new( [] ) Create a

advertisement
CLASS _OT4XB_EXPANDO_ METHOD new( [<nFlags>] ) Create a new _ot4xb_expando_ instance object. Flag 0x10 will cause that set/get methods will be evaluated inside a critical section, it will allow to add/remove properties between different threads. But same critical section is used for all the _ot4xb_expando_ objects of the process , so use this flag only in special cases. METHOD get_prop( <key> ) Retrieve the value of the provided property <key> or NIL if the property not exist. METHOD set_prop( <key>,<v>) Set the value <v> to the property <key> and create the property if not already exist. Always return NIL METHOD is_prop( <key>) Return a logical value indicating if the property already exist .T. METHOD remove_prop( <key> ) Remove a property METHOD find_prop_index( <key>) return the index of the property <key> inside the holder array, or 0 if not exist METHOD set_prop_add( <key>,<v> ) If the <key> property not already exist, have same behavior of the method ::set_prop() If the <key> property already exist will use an array to hold the multiple values of the property. METHOD add_env_strings([<env>]) Add the values of the environment variables of the current process. An alternate <env> string may be used if provided. The <env> string must separate the entries with a Chr(0) and ensure end with a Chr(0)+Chr(0) pair <env> can be a memory pointer or an Xbase++ string. METHOD add_ini_string( <cIniStr> ,<nFlags>) Add properties from the provided <cIniStr> that must have sma structure on a windows .ini file [section] entry=value ;comment line <nFlags> Will be the combination of one or more of the following flags 0 Ignore Section Lines 1 Use the section name followed by a backslash as the prefix of the property names so entries will be stored in this way section\entry=value If this flag is used will not be able to access the properties in the object:key way but still can be use methods :set_prop() and :get_prop() 2 remove the spaces on the left side of the value 4 Combined with the flag 1 will return an array with all the section names. METHOD add_from_array( <aPairs> ) Add properties from a bidimensional array holding key/value pairs of each entry METHOD json_escape_self() Return a json string with the serialized content of the object METHOD GetNoIVar(k) ; return ::get_prop(k) METHOD SetNoIVar(k,v) ; return ::set_prop(k,v) This 2 methods provide the virtual variable support, implemented by the ::set_prop() and ::get_prop() methods ( obj:key [ := value ] ) METHOD _clone() Return another _ot4xb_expando_() instance object holding the same properties METHOD _ToArray() Return a bidimensional array holding the name/value pairs CLASS METHOD from_xml( <xml>,<nFlags>) <xml> can be an xml string or a filename, will work with any <nFlags> Default 0x100 As the XML model is more complex than the Xbase++ object model we will need to provide an specific interpretation when parse XML objects into expando objects and Xbase++ types. The parameter <flags> will define how to interpret the data inside the provided XML Must be one or more the following values ( use always nOr() to combine ) 0x0001 Include ROOT as a node 0x0002 Threat the CDATA islands ( after decode its content ) as simple TEXT 0x0100 Simple mode. DEFAULT (The only supported on the current release) ●
Will be 2 kind of nodes: container and text nodes ●
Namespaces will be ignored on node names and attribute names . ●
Nodes will be stored as properties of the expando object using the node name as the property key ●
Container nodes will be parsed as _ot4xb_expando_() objects ●
Attributes of the text nodes are not saved ●
Flags 0x1000 and 0x2000 will determine how will be stored the attributes of the object nodes ●
CDATA islands will be threat as TEXT when the flag 0x0002 nodes, or just ignored if not, but will not cause the creation of a new object 0x1000 Retrieve XML attributes of the container nodes If not extra disposal flags are provided, the attributes will be stored in the same way as text nodes 0x2000 Only work in combination with flag 0x1000 so to make it effective will need to specify 0x3000. This extra disposal attribute will cause that the attributes will be stored inside a bidimensional array holding the name/value pairs CLASS METHOD json_serialize( <v> ) Helper class method method to serialize any Xbase++ value as a JSON string ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ METHOD m_unserialize_step( v ) METHOD m_on_unserialize_pop() This 2 methods are used by the json parsers to push/pop items and values in the parse stack, not intended to be used directly on the applications. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ This object instance variables are used internally by the object methods, and the direct manipulation directly from the applications may cause undesired behaviors. VAR __m__props__ (internal) Hold a bidimensional array of key&value pairs. Used internally by the methods. VAR __m__hash__ (internal) Binary string holding a 32bit hashes for each key VAR __m__flags__ (internal) VAR __m__serial__ (internal) id of the instance object, unique only inside the current process. used to avoid recursion when serializing the object VAR __m__cargo__ (internal) Used by json parser to hold the temporary stack while unserialize. 
Download