Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-20780

Change the return value of encodeXML(), decodeXML() to be more rational

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.2.0
    • Component/s: JLib
    • Labels:
      None

      Description

      Currently, encodeXML() returns a pointer that points to the end of the input string, that is,

       const char *encodeXML(const char *input, StringBuffer& out, ...)

       const char *encodeXML(const char *input, IIOStream& out, ...)

      returns input+strlen(input).

      The return is not very useful, and in fact, the only use is a recent change in svc_esdl_engine, and uses it wrong (assumes the return value is the out.str()).

      Also note that function encodeUtf8XML() calls encodeXML(), and return encodeXML()'s return, so we need to make sure all instances when the return value of encodeUtf8XML() is used needs to be checked.

      _decodeXML() in jptree.cpp also calls decodeXML() and in turn returns its return.

        Attachments

          Activity

            People

            • Assignee:
              gaojx Jiafu Gao
              Reporter:
              gaojx Jiafu Gao
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: