Ignore:
Timestamp:
Nov 4, 2005 3:19:11 PM (18 years ago)
Author:
dkearney
Message:

1) removed "as" string from c++'s element() function because
the function does not have the capacity to return anything
other than RpLibrary? Instances
2) changed get() functions in library module to return strings.
this change was propagated to matlab, octave, c, fortran, c++
bindings.
3) fixed rpFreeLibrary inside of c interface, now function accepts
a pointer to a pointer to RpLibrary? (lib) and sets *lib equal to
null
4) added doxygen target to makefile. (make docs), to get graphics
you need the program named dot (debian: apt-get install graphviz)
otherwise you will get errors for the portion of the proceedure
where it is trying to create the graphics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/RpLibrary.cc

    r121 r125  
    448448
    449449RpLibrary*
    450 RpLibrary::element (std::string path, std::string as)
     450RpLibrary::element (std::string path)
    451451{
    452452    RpLibrary* retLib;
     
    566566}
    567567
    568 
    569568/**********************************************************************/
    570569// METHOD: get()
    571 /// Return the RpLibrary object held at location 'path'
    572 /**
    573  */
    574 
    575 RpLibrary*
     570/// Return the string value of the object held at location 'path'
     571/**
     572 */
     573
     574std::string
    576575RpLibrary::get (std::string path)
    577576{
    578     RpLibrary* retVal;
    579 
    580     scew_element* retNode = _find(path,0);
    581 
    582     if (retNode == NULL) {
    583         // need to raise error
    584         return NULL;
    585     }
    586 
    587     retVal = new RpLibrary(retNode);
    588 
    589     //who delete's this memory?
    590     return retVal;
    591 }
    592 
    593 /**********************************************************************/
    594 // METHOD: getString()
    595 /// Return the string value of the object held at location 'path'
    596 /**
    597  */
    598 
    599 std::string
    600 RpLibrary::getString (std::string path)
    601 {
    602     // std::string retVal;
    603 
    604     /*
    605     if (path.empty()) {
    606         return "";
    607     }
    608     */
    609 
    610577    scew_element* retNode = _find(path,0);
    611578
     
    615582    }
    616583
    617     // retVal = std::string(scew_element_contents(retNode));
    618     // return retVal;
     584    return std::string(scew_element_contents(retNode));
     585}
     586
     587/**********************************************************************/
     588// METHOD: getString()
     589/// Return the string value of the object held at location 'path'
     590/**
     591 */
     592
     593std::string
     594RpLibrary::getString (std::string path)
     595{
     596    scew_element* retNode = _find(path,0);
     597
     598    if (retNode == NULL) {
     599        // need to raise error
     600        return "";
     601    }
    619602
    620603    return std::string(scew_element_contents(retNode));
Note: See TracChangeset for help on using the changeset viewer.