• George Nash's avatar
    Add oc_endpoint_string_parse_path function · 752a8cfc
    George Nash authored
    This enables getting just the uri portion of an endpoint from
    an endpoint string.
    This is useful for a few reasons.
    - The introspection contains an endpoint string to
      the introspection data. Since we typically already have the
      endpoint there is no need to used the oc_string_to_endpoint
      function and allocate another copy of the endpoint when we are
      only interested in the path part of the string.
    - Language bindings with Java. Functions that return multiple
      values through variables require unusual workarounds to get
      a clean Java API.  By making this availible in a separate
      function we can make two functions with only one
      responability. Making the Java APIs cleaner.
    While testing the oc_endpoint_string_parse_path function
    multiple failures showed up in the StringToEndpoint unit test.
    Once I figured out the failures were due to the fact that my
    build did not have IPV4=1 I updated the StringToEndpoint test so
    it will not test IPV4 strings if OC_IPV4 is not defined.
    Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
eptest.cpp 11.1 KB