Changeset 192 for trunk/include


Ignore:
Timestamp:
Feb 19, 2006, 10:40:13 AM (19 years ago)
Author:
dkearney
Message:

1) added nodePath() function to core RpLibrary?, this fxn returns the full·
path of a given element
2) added parent() fxn to core RpLibrary?, this fxn retrieves the parent·
node of a given path
3) added put() fxn to core RpLibrary?, this fxn allows user to put an·
RpLibrary? element into an xml tree at the provided path
4) removed restrictions on not being able to send empty path to put()·
fxns. empty paths will be interpreted as the root of the xml tree.
5) enabled all RpLibrary? objects to include which tryy an object came·
from, adjusted RpLibrary?.h:339. this change will not require/allow·
RpLibrary? Objects to destroy the tree they came from, it is only for·
reference purposes.
6) added new libscew fxn - scew_element_copy, as a low level fxn to copy·
a scew xml element and return a new scew xml element that is not related·
to any xml tree. the new element is created with scew_element_create.·
all attributes and children are also copied to the new element.
7) added new libscew fxn - scew_element_copy_attr, as a low level fxn to·
copy the attributes from one scew element to another scew element.
8) fixed bugs in children() fxn where user is looking for a specific type·
of child, the search hits the end of the list, and fxn failed to check if·
the childNode was null before calling operations on it.
9) adjusted RpLibrary?'s private constructor to set the default value for·
the freeTree flag to 0 (zero). in the cases where we use this private·
constructor, the new objects that are created are only used as reference·
and should not actually be used as real RpLibraries? with real xml trees.

Location:
trunk/include/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/core/RpLibrary.h

    r125 r192  
    3535
    3636        RpLibrary* element (std::string path = "");
     37        RpLibrary* parent (std::string path = "");
    3738
    3839        // should return RpObject& but for simplicity right now it doesnt
     
    4445                                int* childCount = NULL  );
    4546
     47        RpLibrary& copy       ( std::string toPath,
     48                                std::string fromPath,
     49                                RpLibrary* fromObj = NULL);
     50
    4651        std::string get       ( std::string path = "");
    4752        std::string getString ( std::string path = "");
     
    5863                            int append = 0  );
    5964
     65        RpLibrary& put (    std::string path,
     66                            RpLibrary* value,
     67                            std::string id = "",
     68                            int append = 0  );
     69
    6070        RpLibrary& remove (std::string path = "");
    6171
     
    6575        std::string nodeId();
    6676        std::string nodeComp();
     77        std::string nodePath();
    6778
    6879        void result();
     
    324335
    325336
    326         RpLibrary ( scew_element* node)
     337        RpLibrary ( scew_element* node, scew_tree* tree)
    327338            :   parser      (NULL),
    328                 tree        (NULL),
     339                tree        (tree),
    329340                root        (node)
    330341
    331         {}
     342        {
     343            freeTree = 0;
     344        }
    332345
    333346
     
    336349        std::string _node2name (scew_element* node);
    337350        std::string _node2comp (scew_element* node);
     351        std::string _node2path (scew_element* node);
     352
    338353        int _splitPath (std::string& path,
    339354                        std::string& tagName,
  • trunk/include/core/scew_extras.h

    r115 r192  
    77 * ======================================================================
    88 */
    9 #ifdef __cplusplus 
     9#ifdef __cplusplus
    1010extern "C" {
    1111#endif
    1212
    13 extern scew_element* 
     13extern scew_element*
    1414scew_element_parent(scew_element const* element);
    1515
     
    2323scew_element_list_all(scew_element const* parent, unsigned int* count);
    2424
    25 #ifdef __cplusplus
     25extern int
     26scew_element_copy_attr(scew_element const* fromElement, scew_element* toElement);
     27
     28extern scew_element*
     29scew_element_copy (scew_element* element);
     30
     31#ifdef __cplusplus
    2632}
    2733#endif
Note: See TracChangeset for help on using the changeset viewer.