Sfoglia il codice sorgente

HPCC-22763 Fix windows build problems

* The new PropertyTreeXmlWriter class caused a strange clash on
  CSimpleInterfaceOf<IXmlWriter>, and can be replaced with existing class

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 5 anni fa
parent
commit
53f026ed62

+ 2 - 2
common/thorhelper/thorread.cpp

@@ -508,7 +508,7 @@ protected:
 
 private:
     template <class PROCESS>
-    inline const void * inlineNextRow(PROCESS processor) __attribute((always_inline));
+    inline const void * inlineNextRow(PROCESS processor) __attribute__((always_inline));
 
 protected:
     ISourceRowPrefetcher * actualRowPrefetcher = nullptr;
@@ -1238,7 +1238,7 @@ public:
 
 private:
     template <class PROCESS>
-    inline const void * inlineNextRow(PROCESS processor) __attribute((always_inline));
+    inline const void * inlineNextRow(PROCESS processor) __attribute__((always_inline));
 
 protected:
     ISourceRowPrefetcher * projectedRowPrefetcher = nullptr;

+ 0 - 143
common/thorhelper/thorxmlwrite.cpp

@@ -150,146 +150,3 @@ extern thorhelper_decl void convertRowToJSON(size32_t & lenResult, char * & resu
     rtlStrToStrX(sizeResult, result, writer.length(), writer.str());
     lenResult = rtlUtf8Length(sizeResult, result);
 }
-
-
-//=============================================================================================
-
-void PropertyTreeXmlWriter::outputLiteralString(size32_t size, const char *value, const char *fieldname)
-{
-    //Horrible that there is no interface for adding a (len, data) string
-    StringBuffer temp;
-    temp.append(size, value);
-    root->addProp(fieldname, temp.str());
-}
-
-void PropertyTreeXmlWriter::outputInlineXml(const char *text)
-{
-    throwUnexpected();
-}
-
-void PropertyTreeXmlWriter::outputQuoted(const char *text)
-{
-    throwUnexpected();
-}
-
-void PropertyTreeXmlWriter::outputQString(unsigned len, const char *value, const char *fieldname)
-{
-    MemoryAttr tempBuffer;
-    char * temp = (char *)tempBuffer.allocate(len);
-    rtlQStrToStr(len, temp, len, value);
-    outputString(len, temp, fieldname);
-}
-
-void PropertyTreeXmlWriter::outputString(unsigned len, const char *value, const char *fieldname)
-{
-    size32_t resultLen;
-    rtlDataAttr result;
-    rtlStrToUtf8X(resultLen, result.refstr(), len, value);
-
-    size32_t size = rtlUtf8Size(resultLen, result.getstr());
-    outputLiteralString(size, result.getstr(), fieldname);
-}
-
-void PropertyTreeXmlWriter::outputBool(bool value, const char *fieldname)
-{
-    root->setPropBool(fieldname, value);
-}
-
-void PropertyTreeXmlWriter::outputData(unsigned len, const void *value, const char *fieldname)
-{
-    root->setPropBin(fieldname, len, value);
-}
-
-void PropertyTreeXmlWriter::outputInt(__int64 value, unsigned size, const char *fieldname)
-{
-    root->setPropInt64(fieldname, value);
-}
-
-void PropertyTreeXmlWriter::outputUInt(unsigned __int64 value, unsigned size, const char *fieldname)
-{
-    //Convert to string first?
-    root->setPropInt64(fieldname, value);
-}
-
-void PropertyTreeXmlWriter::outputReal(double value, const char *fieldname)
-{
-    StringAttr temp;
-    temp.setown(rtlRealToVStrX(value));
-    root->setProp(fieldname, temp);
-}
-
-void PropertyTreeXmlWriter::outputDecimal(const void *value, unsigned size, unsigned precision, const char *fieldname)
-{
-    Decimal temp;
-    char text[50];
-    temp.setDecimal(size, precision, value);
-    temp.getCString(sizeof(text), text);
-    root->setProp(fieldname, text);
-}
-
-void PropertyTreeXmlWriter::outputUDecimal(const void *value, unsigned size, unsigned precision, const char *fieldname)
-{
-    Decimal temp;
-    char text[50];
-    temp.setUDecimal(size, precision, value);
-    temp.getCString(sizeof(text), text);
-    root->setProp(fieldname, text);
-}
-
-void PropertyTreeXmlWriter::outputUnicode(unsigned len, const UChar *value, const char *fieldname)
-{
-    size32_t resultLen;
-    rtlDataAttr result;
-    rtlUnicodeToUtf8X(resultLen, result.refstr(), len, value);
-
-    size32_t size = rtlUtf8Size(resultLen, result.getstr());
-    outputLiteralString(size, result.getstr(), fieldname);
-}
-
-void PropertyTreeXmlWriter::outputUtf8(unsigned len, const char *value, const char *fieldname)
-{
-    size32_t size = rtlUtf8Size(len, value);
-    outputLiteralString(size, value, fieldname);
-}
-
-void PropertyTreeXmlWriter::outputBeginDataset(const char *fieldname, bool nestChildren)
-{
-    stack.append(*root);
-    root = root->setPropTree(fieldname);
-}
-
-void PropertyTreeXmlWriter::outputEndDataset(const char *fieldname)
-{
-    root = &stack.popGet();
-}
-
-void PropertyTreeXmlWriter::outputBeginNested(const char *fieldname, bool nestChildren)
-{
-    stack.append(*root);
-    root = root->setPropTree(fieldname);
-}
-
-void PropertyTreeXmlWriter::outputEndNested(const char *fieldname)
-{
-    root = &stack.popGet();
-}
-
-void PropertyTreeXmlWriter::outputBeginArray(const char *fieldname) //repeated elements are inline for xml
-{
-    throwUnexpected();
-}
-
-void PropertyTreeXmlWriter::outputEndArray(const char *fieldname)
-{
-    throwUnexpected();
-}
-
-void PropertyTreeXmlWriter::outputSetAll()
-{
-    throwUnexpected();
-}
-
-void PropertyTreeXmlWriter::outputXmlns(const char *name, const char *uri)
-{
-    throwUnexpected();
-}

+ 0 - 37
common/thorhelper/thorxmlwrite.hpp

@@ -57,43 +57,6 @@ public:
 
 };
 
-class thorhelper_decl PropertyTreeXmlWriter : implements CInterfaceOf<IXmlWriter>
-{
-public:
-    PropertyTreeXmlWriter(IPropertyTree * _root) : root(_root) {}
-
-    virtual void outputInlineXml(const char *text) override;
-    virtual void outputQuoted(const char *text) override;
-    virtual void outputQString(unsigned len, const char *field, const char *fieldname) override;
-    virtual void outputString(unsigned len, const char *field, const char *fieldname) override;
-    virtual void outputBool(bool field, const char *fieldname) override;
-    virtual void outputData(unsigned len, const void *field, const char *fieldname) override;
-    virtual void outputInt(__int64 field, unsigned size, const char *fieldname) override;
-    virtual void outputUInt(unsigned __int64 field, unsigned size, const char *fieldname) override;
-    virtual void outputReal(double field, const char *fieldname) override;
-    virtual void outputDecimal(const void *field, unsigned size, unsigned precision, const char *fieldname) override;
-    virtual void outputUDecimal(const void *field, unsigned size, unsigned precision, const char *fieldname) override;
-    virtual void outputUnicode(unsigned len, const UChar *field, const char *fieldname) override;
-    virtual void outputUtf8(unsigned len, const char *field, const char *fieldname) override;
-    virtual void outputBeginDataset(const char *dsname, bool nestChildren) override;
-    virtual void outputEndDataset(const char *dsname) override;
-    virtual void outputBeginNested(const char *fieldname, bool nestChildren) override;
-    virtual void outputEndNested(const char *fieldname) override;
-    virtual void outputBeginArray(const char *fieldname) override; //repeated elements are inline for xml
-    virtual void outputEndArray(const char *fieldname) override;
-    virtual void outputSetAll() override;
-    virtual void outputXmlns(const char *name, const char *uri) override;
-
-protected:
-    void outputLiteralString(size32_t size, const char *value, const char *fieldname);
-
-protected:
-    IPropertyTree * root;
-    ICopyArrayOf<IPropertyTree> stack;
-};
-
-
-
 extern thorhelper_decl void printKeyedValues(StringBuffer &out, IIndexReadContext *segs, IOutputMetaData *rowMeta);
 
 extern thorhelper_decl void convertRowToXML(size32_t & lenResult, char * & result, IOutputMetaData & info, const void * row, unsigned flags = (unsigned)-1);

+ 4 - 3
ecl/hthor/hthor.cpp

@@ -45,6 +45,7 @@
 #include "thorsort.hpp"
 #include "thorparse.ipp"
 #include "thorxmlwrite.hpp"
+#include "rtlformat.hpp"
 #include "thorcommon.hpp"
 #include "jsmartsock.hpp"
 #include "thorstep.hpp"
@@ -1615,7 +1616,7 @@ public:
         {
             writeTransformer->writeTranslatedText(row, pipe);
         }
-        catch (IException *e)
+        catch (IException *)
         {
             ReleaseRoxieRow(row);
             throw;
@@ -10443,7 +10444,7 @@ CHThorNewDiskReadBaseActivity::CHThorNewDiskReadBaseActivity(IAgentContext &_age
             recordTranslationModeHint = getTranslationMode(recordTranslationModeHintText);
     }
 
-    PropertyTreeXmlWriter writer(formatOptions);
+    CPropertyTreeWriter writer(formatOptions);
     helper.getFormatOptions(writer);
 }
 
@@ -10505,7 +10506,7 @@ void CHThorNewDiskReadBaseActivity::resolveFile()
     if (helper.getFlags() & TDRdynformatoptions)
     {
         curFormatOptions.setown(createPTreeFromIPT(formatOptions));
-        PropertyTreeXmlWriter writer(curFormatOptions);
+        CPropertyTreeWriter writer(curFormatOptions);
         helper.getFormatDynOptions(writer);
     }
     else