|
@@ -1,6 +1,6 @@
|
|
|
/*##############################################################################
|
|
|
|
|
|
- HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems®.
|
|
|
+ HPCC SYSTEMS software Copyright (C) 2016 HPCC Systems®.
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
you may not use this file except in compliance with the License.
|
|
@@ -21,11 +21,6 @@
|
|
|
#include "jarray.hpp"
|
|
|
#include "jhash.hpp"
|
|
|
#include "XMLTags.h"
|
|
|
-
|
|
|
-
|
|
|
-//#define ::StringBuffer ::::StringBuffer
|
|
|
-//#define ::IPropertyTree ::::IPropertyTree
|
|
|
-
|
|
|
#include "SchemaAnnotation.hpp"
|
|
|
#include "SchemaCommon.hpp"
|
|
|
#include "SchemaElement.hpp"
|
|
@@ -45,14 +40,14 @@ using namespace CONFIGURATOR;
|
|
|
|
|
|
const CXSDNodeBase* CElement::getNodeByTypeAndNameAscending(NODE_TYPES eNodeType, const char *pName) const
|
|
|
{
|
|
|
- const CXSDNodeBase* pMatchingNode = NULL;
|
|
|
+ const CXSDNodeBase* pMatchingNode = nullptr;
|
|
|
|
|
|
- if (eNodeType == this->getNodeType() && (pName != NULL ? !strcmp(pName, this->getNodeTypeStr()) : true))
|
|
|
+ if (eNodeType == this->getNodeType() && (pName != nullptr ? !strcmp(pName, this->getNodeTypeStr()) : true))
|
|
|
return this;
|
|
|
|
|
|
if (eNodeType == XSD_ELEMENT)
|
|
|
pMatchingNode = (dynamic_cast<CElement*>(this->getParentNode()))->getNodeByTypeAndNameAscending(XSD_ELEMENT, pName);
|
|
|
- if (pMatchingNode == NULL)
|
|
|
+ if (pMatchingNode == nullptr)
|
|
|
pMatchingNode = (dynamic_cast<CElementArray*>(this->getParentNode()))->getNodeByTypeAndNameAscending(eNodeType, pName);
|
|
|
|
|
|
return pMatchingNode;
|
|
@@ -60,11 +55,11 @@ const CXSDNodeBase* CElement::getNodeByTypeAndNameAscending(NODE_TYPES eNodeType
|
|
|
|
|
|
const CXSDNodeBase* CElement::getNodeByTypeAndNameDescending(NODE_TYPES eNodeType, const char *pName) const
|
|
|
{
|
|
|
- const CXSDNodeBase* pMatchingNode = NULL;
|
|
|
+ const CXSDNodeBase* pMatchingNode = nullptr;
|
|
|
|
|
|
- if (eNodeType == this->getNodeType() && (pName != NULL ? !strcmp(pName, this->getNodeTypeStr()) : true))
|
|
|
+ if (eNodeType == this->getNodeType() && (pName != nullptr ? !strcmp(pName, this->getNodeTypeStr()) : true))
|
|
|
return this;
|
|
|
- if (m_pComplexTypeArray != NULL)
|
|
|
+ if (m_pComplexTypeArray != nullptr)
|
|
|
pMatchingNode = m_pComplexTypeArray->getNodeByTypeAndNameDescending(eNodeType, pName);
|
|
|
|
|
|
return pMatchingNode;
|
|
@@ -72,11 +67,11 @@ const CXSDNodeBase* CElement::getNodeByTypeAndNameDescending(NODE_TYPES eNodeTyp
|
|
|
|
|
|
CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath, bool bIsInXSD)
|
|
|
{
|
|
|
- assert(pSchemaRoot != NULL);
|
|
|
- assert(pParentNode != NULL);
|
|
|
+ assert(pSchemaRoot != nullptr);
|
|
|
+ assert(pParentNode != nullptr);
|
|
|
|
|
|
- if (pSchemaRoot == NULL || pParentNode == NULL)
|
|
|
- return NULL;
|
|
|
+ if (pSchemaRoot == nullptr || pParentNode == nullptr)
|
|
|
+ return nullptr;
|
|
|
|
|
|
CElement *pElement = new CElement(pParentNode);
|
|
|
|
|
@@ -85,7 +80,7 @@ CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSche
|
|
|
|
|
|
::IPropertyTree *pTree = pSchemaRoot->queryPropTree(xpath);
|
|
|
|
|
|
- if (pElement != NULL && pTree != NULL)
|
|
|
+ if (pTree != nullptr)
|
|
|
pElement->setName(pTree->queryProp(XML_ATTR_NAME));
|
|
|
|
|
|
Owned<IAttributeIterator> iterAttrib = pTree->getAttributes(true);
|
|
@@ -96,7 +91,7 @@ CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSche
|
|
|
{
|
|
|
const char *pName = iterAttrib->queryValue();
|
|
|
|
|
|
- if (pName != NULL && *pName != 0)
|
|
|
+ if (pName != nullptr && *pName != 0)
|
|
|
pElement->setName(pName);
|
|
|
}
|
|
|
else if (strcmp(iterAttrib->queryName(), XML_ATTR_MAXOCCURS) == 0)
|
|
@@ -107,9 +102,9 @@ CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSche
|
|
|
{
|
|
|
const char *pType = iterAttrib->queryValue();
|
|
|
|
|
|
- assert(pType != NULL && *pType != 0);
|
|
|
+ assert(pType != nullptr && *pType != 0);
|
|
|
|
|
|
- if (pType != NULL && *pType != 0)
|
|
|
+ if (pType != nullptr && *pType != 0)
|
|
|
{
|
|
|
pElement->setType(pType);
|
|
|
CConfigSchemaHelper::getInstance()->addNodeForTypeProcessing(pElement);
|
|
@@ -119,9 +114,9 @@ CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSche
|
|
|
{
|
|
|
const char *pRef = iterAttrib->queryValue();
|
|
|
|
|
|
- assert (pRef != NULL && *pRef != 0 && pElement->getConstAncestorNode(3)->getNodeType() != XSD_SCHEMA);
|
|
|
+ assert (pRef != nullptr && *pRef != 0 && pElement->getConstAncestorNode(3)->getNodeType() != XSD_SCHEMA);
|
|
|
|
|
|
- if (pRef != NULL && *pRef != 0 && pElement->getConstAncestorNode(3)->getNodeType() != XSD_SCHEMA)
|
|
|
+ if (pRef != nullptr && *pRef != 0 && pElement->getConstAncestorNode(3)->getNodeType() != XSD_SCHEMA)
|
|
|
{
|
|
|
pElement->setRef(pRef);
|
|
|
CConfigSchemaHelper::getInstance()->addElementForRefProcessing(pElement);
|
|
@@ -135,34 +130,32 @@ CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSche
|
|
|
{
|
|
|
const char *pDefault = iterAttrib->queryValue();
|
|
|
|
|
|
- assert(pDefault != NULL);
|
|
|
+ assert(pDefault != nullptr);
|
|
|
assert(strlen(pElement->getDefault()) == 0);
|
|
|
pElement->setDefault(pDefault);
|
|
|
}
|
|
|
- assert(iterAttrib->queryValue() != NULL);
|
|
|
+ assert(iterAttrib->queryValue() != nullptr);
|
|
|
}
|
|
|
assert(strlen(pElement->getName()) > 0);
|
|
|
|
|
|
if (strlen(pElement->getRef()) != 0)
|
|
|
{
|
|
|
assert(pElement->getComplexTypeArray()->length() == 0);
|
|
|
- assert(pElement->getSimpleType() == NULL);
|
|
|
+ assert(pElement->getSimpleType() == nullptr);
|
|
|
assert(strlen(pElement->getDefault()) == 0);
|
|
|
assert(strlen(pElement->getType()) == 0);
|
|
|
- /*assert(pElement->getKey() == NULL);
|
|
|
- assert(pElement->getKeyRef() == NULL);
|
|
|
- assert(pElement->getUnique() == NULL);*/
|
|
|
+ /*assert(pElement->getKey() == nullptr);
|
|
|
+ assert(pElement->getKeyRef() == nullptr);
|
|
|
+ assert(pElement->getUnique() == nullptr);*/
|
|
|
}
|
|
|
|
|
|
- ::StringBuffer strXPathExt(xpath);
|
|
|
-
|
|
|
- strXPathExt.append("/").append(XSD_TAG_ANNOTATION);
|
|
|
+ ::VStringBuffer strXPathExt("%s/%s", xpath, XSD_TAG_ANNOTATION);
|
|
|
pElement->m_pAnnotation = CAnnotation::load(pElement, pSchemaRoot, strXPathExt.str());
|
|
|
|
|
|
- strXPathExt.clear().append(xpath).append("/").append(XSD_TAG_COMPLEX_TYPE);
|
|
|
+ strXPathExt.setf("%s/%s", xpath, XSD_TAG_COMPLEX_TYPE);
|
|
|
pElement->m_pComplexTypeArray = CComplexTypeArray::load(pElement, pSchemaRoot, strXPathExt.str());
|
|
|
|
|
|
- if (pElement->m_pAnnotation != NULL && pElement->m_pAnnotation->getAppInfo() != NULL && strlen(pElement->m_pAnnotation->getAppInfo()->getTitle()) > 0)
|
|
|
+ if (pElement->m_pAnnotation != nullptr && pElement->m_pAnnotation->getAppInfo() != nullptr && strlen(pElement->m_pAnnotation->getAppInfo()->getTitle()) > 0)
|
|
|
{
|
|
|
/**** MUST FIX TO HAVE CORRECT UI TAB LABELS (but getName is expected to return the XPATH name *****/
|
|
|
//pElement->setName(pElement->m_pAnnotation->getAppInfo()->getTitle());
|
|
@@ -171,13 +164,13 @@ CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSche
|
|
|
else
|
|
|
pElement->setTitle(pElement->getName());
|
|
|
|
|
|
-/* strXPathExt.clear().append(xpath).append("/").append(XSD_TAG_KEY);
|
|
|
+/* strXPathExt.setf("%s/%s", xpath, XSD_TAG_KEY);
|
|
|
pElement->m_pKeyArray = CKeyArray::load(pElement, pSchemaRoot, strXPathExt.str());
|
|
|
|
|
|
- strXPathExt.clear().append(xpath).append("/").append(XSD_TAG_KEYREF);
|
|
|
+ strXPathExt.setf("%s/%s", xpath, XSD_TAG_KEYREF);
|
|
|
pElement->m_pKeyRefArray = CKeyRefArray::load(pElement, pSchemaRoot, strXPathExt.str());
|
|
|
*/
|
|
|
- strXPathExt.clear().append(xpath).append("/").append(XSD_TAG_SIMPLE_TYPE);
|
|
|
+ strXPathExt.setf("%s/%s", xpath, XSD_TAG_SIMPLE_TYPE);
|
|
|
pElement->m_pSimpleType = CSimpleType::load(pElement, pSchemaRoot, strXPathExt.str());
|
|
|
|
|
|
SETPARENTNODE(pElement, pParentNode);
|
|
@@ -187,15 +180,12 @@ CElement* CElement::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSche
|
|
|
|
|
|
const CElement* CElement::getTopMostElement(const CXSDNodeBase *pNode)
|
|
|
{
|
|
|
- if (pNode == NULL)
|
|
|
- return NULL;
|
|
|
- else if (pNode->getNodeType() == XSD_ELEMENT)
|
|
|
+ if (pNode == nullptr)
|
|
|
+ return nullptr;
|
|
|
+ else if (pNode->getNodeType() == XSD_ELEMENT && pNode->getParentNodeByType(XSD_ELEMENT) == nullptr)
|
|
|
{
|
|
|
- if (pNode->getParentNodeByType(XSD_ELEMENT) == NULL)
|
|
|
- {
|
|
|
- assert(dynamic_cast<const CElement*>(pNode) != NULL);
|
|
|
- return dynamic_cast<const CElement*>(pNode);
|
|
|
- }
|
|
|
+ assert(dynamic_cast<const CElement*>(pNode) != nullptr);
|
|
|
+ return dynamic_cast<const CElement*>(pNode);
|
|
|
}
|
|
|
return getTopMostElement(pNode->getParentNodeByType(XSD_ELEMENT));
|
|
|
}
|
|
@@ -212,14 +202,14 @@ const char* CElement::getXML(const char* /*pComponent*/)
|
|
|
{
|
|
|
m_strXML.append("\n<").append(getName()).append(" ");
|
|
|
|
|
|
- if (m_pAnnotation != NULL)
|
|
|
- m_strXML.append(m_pAnnotation->getXML(NULL));
|
|
|
- if (m_pComplexTypeArray != NULL)
|
|
|
- m_strXML.append(m_pComplexTypeArray->getXML(NULL));
|
|
|
- if (m_pKeyArray != NULL)
|
|
|
- m_strXML.append(m_pKeyArray->getXML(NULL));
|
|
|
- if (m_pKeyRefArray != NULL)
|
|
|
- m_strXML.append(m_pKeyRefArray->getXML(NULL));
|
|
|
+ if (m_pAnnotation != nullptr)
|
|
|
+ m_strXML.append(m_pAnnotation->getXML(nullptr));
|
|
|
+ if (m_pComplexTypeArray != nullptr)
|
|
|
+ m_strXML.append(m_pComplexTypeArray->getXML(nullptr));
|
|
|
+ if (m_pKeyArray != nullptr)
|
|
|
+ m_strXML.append(m_pKeyArray->getXML(nullptr));
|
|
|
+ if (m_pKeyRefArray != nullptr)
|
|
|
+ m_strXML.append(m_pKeyRefArray->getXML(nullptr));
|
|
|
}
|
|
|
return m_strXML.str();
|
|
|
}
|
|
@@ -228,7 +218,7 @@ void CElement::dump(::std::ostream &cout, unsigned int offset) const
|
|
|
{
|
|
|
offset += STANDARD_OFFSET_1;
|
|
|
|
|
|
- QuickOutHeader(cout, XSD_ELEMENT_STR, offset);
|
|
|
+ quickOutHeader(cout, XSD_ELEMENT_STR, offset);
|
|
|
QUICK_OUT(cout, Name, offset);
|
|
|
QUICK_OUT(cout, Type, offset);
|
|
|
QUICK_OUT(cout, MinOccurs, offset);
|
|
@@ -239,42 +229,42 @@ void CElement::dump(::std::ostream &cout, unsigned int offset) const
|
|
|
QUICK_OUT(cout, EnvValueFromXML, offset);
|
|
|
QUICK_OUT(cout, Ref, offset);
|
|
|
|
|
|
- if (this->getTypeNode() != NULL)
|
|
|
+ if (this->getTypeNode() != nullptr)
|
|
|
this->getTypeNode()->dump(cout, offset);
|
|
|
- if (m_pAnnotation != NULL)
|
|
|
+ if (m_pAnnotation != nullptr)
|
|
|
m_pAnnotation->dump(cout, offset);
|
|
|
- if (m_pComplexTypeArray != NULL)
|
|
|
+ if (m_pComplexTypeArray != nullptr)
|
|
|
m_pComplexTypeArray->dump(cout, offset);
|
|
|
- if (m_pKeyArray != NULL)
|
|
|
+ if (m_pKeyArray != nullptr)
|
|
|
m_pKeyArray->dump(cout, offset);
|
|
|
- if (m_pKeyRefArray != NULL)
|
|
|
+ if (m_pKeyRefArray != nullptr)
|
|
|
m_pKeyRefArray->dump(cout, offset);
|
|
|
- if (m_pSimpleType != NULL)
|
|
|
+ if (m_pSimpleType != nullptr)
|
|
|
m_pSimpleType->dump(cout, offset);
|
|
|
|
|
|
- if (this->getRef() != NULL)
|
|
|
+ if (this->getRef() != nullptr)
|
|
|
{
|
|
|
CElement *pElement = CConfigSchemaHelper::getInstance()->getSchemaMapManager()->getElementWithName(this->getRef());
|
|
|
|
|
|
- assert(pElement != NULL);
|
|
|
- if (pElement != NULL)
|
|
|
+ assert(pElement != nullptr);
|
|
|
+ if (pElement != nullptr)
|
|
|
pElement->dump(cout, offset);
|
|
|
}
|
|
|
- QuickOutFooter(cout, XSD_ELEMENT_STR, offset);
|
|
|
+ quickOutFooter(cout, XSD_ELEMENT_STR, offset);
|
|
|
}
|
|
|
|
|
|
void CElement::getDocumentation(::StringBuffer &strDoc) const
|
|
|
{
|
|
|
const CXSDNodeBase *pGrandParentNode = this->getConstParentNode()->getConstParentNode();
|
|
|
|
|
|
- assert(pGrandParentNode != NULL);
|
|
|
- if (pGrandParentNode == NULL)
|
|
|
+ assert(pGrandParentNode != nullptr);
|
|
|
+ if (pGrandParentNode == nullptr)
|
|
|
return;
|
|
|
|
|
|
- if (m_pAnnotation != NULL && m_pAnnotation->getAppInfo() != NULL && m_pAnnotation->getAppInfo()->getViewType() != NULL && stricmp(m_pAnnotation->getAppInfo()->getViewType(), "none") == 0)
|
|
|
+ if (m_pAnnotation != nullptr && m_pAnnotation->getAppInfo() != nullptr && m_pAnnotation->getAppInfo()->getViewType() != nullptr && stricmp(m_pAnnotation->getAppInfo()->getViewType(), "none") == 0)
|
|
|
return;
|
|
|
|
|
|
- if (this->getName() != NULL && (stricmp(this->getName(), "Instance") == 0 || stricmp(this->getName(), "Note") == 0 || stricmp(this->getName(), "Notes") == 0 || stricmp(this->getName(), "Topology") == 0 ))
|
|
|
+ if (this->getName() != nullptr && (stricmp(this->getName(), "Instance") == 0 || stricmp(this->getName(), "Note") == 0 || stricmp(this->getName(), "Notes") == 0 || stricmp(this->getName(), "Topology") == 0 ))
|
|
|
return; // don't document instance
|
|
|
|
|
|
assert(strlen(this->getName()) > 0);
|
|
@@ -290,7 +280,7 @@ void CElement::getDocumentation(::StringBuffer &strDoc) const
|
|
|
strDoc.appendf("<%s %s=\"%s%s\">\n", DM_SECT2, DM_ID, strName.str(),"_mod");
|
|
|
strDoc.appendf("<%s>%s</%s>\n", DM_TITLE_LITERAL, this->getName(), DM_TITLE_LITERAL);
|
|
|
|
|
|
- if (m_pAnnotation!= NULL)
|
|
|
+ if (m_pAnnotation!= nullptr)
|
|
|
{
|
|
|
m_pAnnotation->getDocumentation(strDoc);
|
|
|
DEBUG_MARK_STRDOC;
|
|
@@ -300,15 +290,15 @@ void CElement::getDocumentation(::StringBuffer &strDoc) const
|
|
|
DEBUG_MARK_STRDOC;
|
|
|
strDoc.append(DM_TITLE_BEGIN).append(DM_TITLE_END);
|
|
|
|
|
|
- if (m_pComplexTypeArray != NULL)
|
|
|
+ if (m_pComplexTypeArray != nullptr)
|
|
|
m_pComplexTypeArray->getDocumentation(strDoc);
|
|
|
|
|
|
strDoc.append(DM_SECT3_END);
|
|
|
return;
|
|
|
}
|
|
|
- else if (m_pComplexTypeArray != NULL)
|
|
|
+ else if (m_pComplexTypeArray != nullptr)
|
|
|
{
|
|
|
- if (m_pAnnotation!= NULL)
|
|
|
+ if (m_pAnnotation!= nullptr)
|
|
|
{
|
|
|
m_pAnnotation->getDocumentation(strDoc);
|
|
|
DEBUG_MARK_STRDOC;
|
|
@@ -322,9 +312,9 @@ void CElement::getDocumentation(::StringBuffer &strDoc) const
|
|
|
DEBUG_MARK_STRDOC;
|
|
|
m_pComplexTypeArray->getDocumentation(strDoc);
|
|
|
}
|
|
|
- else if (m_pComplexTypeArray == NULL)
|
|
|
+ else if (m_pComplexTypeArray == nullptr)
|
|
|
{
|
|
|
- if (m_pAnnotation!= NULL)
|
|
|
+ if (m_pAnnotation!= nullptr)
|
|
|
{
|
|
|
m_pAnnotation->getDocumentation(strDoc);
|
|
|
DEBUG_MARK_STRDOC;
|
|
@@ -333,7 +323,7 @@ void CElement::getDocumentation(::StringBuffer &strDoc) const
|
|
|
strDoc.appendf("%s%s%s", DM_PARA_BEGIN, this->getName(), DM_PARA_END);
|
|
|
DEBUG_MARK_STRDOC;
|
|
|
|
|
|
- if (m_pAnnotation != NULL && m_pAnnotation->getDocumentation() != NULL)
|
|
|
+ if (m_pAnnotation != nullptr && m_pAnnotation->getDocumentation() != nullptr)
|
|
|
{
|
|
|
m_pAnnotation->getDocumentation(strDoc);
|
|
|
DEBUG_MARK_STRDOC;
|
|
@@ -343,46 +333,32 @@ void CElement::getDocumentation(::StringBuffer &strDoc) const
|
|
|
|
|
|
void CElement::getJSON(::StringBuffer &strJSON, unsigned int offset, int idx) const
|
|
|
{
|
|
|
- assert(this->getConstAncestorNode(3) != NULL);
|
|
|
-
|
|
|
-// if (m_pAnnotation != NULL && m_pAnnotation->getAppInfo() != NULL && m_pAnnotation->getAppInfo()->getViewType() != NULL && stricmp(m_pAnnotation->getAppInfo()->getViewType(), "none") == 0)
|
|
|
-// return;
|
|
|
-
|
|
|
assert(strlen(this->getName()) > 0);
|
|
|
|
|
|
StringBuffer strXPath(this->getEnvXPath());
|
|
|
-
|
|
|
stripTrailingIndex(strXPath);
|
|
|
|
|
|
- if (m_pComplexTypeArray != NULL && m_pComplexTypeArray->length() > 0)
|
|
|
+ if (m_pComplexTypeArray != nullptr && m_pComplexTypeArray->length() > 0)
|
|
|
{
|
|
|
- //CJSONMarkUpHelper::createUIContent(strJSON, offset, (this->getMaxOccursInt() > 1 || strlen(this->getMinOccurs()) > 0) ? JSON_TYPE_TABLE : JSON_TYPE_TAB, this->getTitle(), this->getEnvXPath());
|
|
|
|
|
|
- //CJSONMarkUpHelper::createUIContent(strJSON, offset, (this->getMaxOccursInt() > 1 || strlen(this->getMinOccurs()) > 0) ? JSON_TYPE_TABLE : JSON_TYPE_TAB, this->getTitle(), strXPath.str());
|
|
|
CJSONMarkUpHelper::createUIContent(strJSON, offset, JSON_TYPE_TAB, this->getTitle(), strXPath.str());
|
|
|
-
|
|
|
m_pComplexTypeArray->getJSON(strJSON, offset);
|
|
|
}
|
|
|
else
|
|
|
- {
|
|
|
- //CJSONMarkUpHelper::createUIContent(strJSON, offset, JSON_TYPE_TABLE, this->getTitle(), this->getEnvXPath());
|
|
|
CJSONMarkUpHelper::createUIContent(strJSON, offset, JSON_TYPE_TABLE, this->getTitle(), strXPath.str());
|
|
|
- // add values
|
|
|
- //CJSONMarkUpHelper::createUIContent(strJSON, offset, JSON_TYPE_INPUT, this->getTitle(), strXPath.str());
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|
|
|
bool CElement::isATab() const
|
|
|
{
|
|
|
const CComplexTypeArray *pComplexTypArray = this->getComplexTypeArray();
|
|
|
- const CAttributeGroupArray *pAttributeGroupArray = (pComplexTypArray != NULL && pComplexTypArray->length() > 0) ? pComplexTypArray->item(0).getAttributeGroupArray() : NULL;
|
|
|
- const CAttributeArray *pAttributeArray = (pComplexTypArray != NULL && pComplexTypArray->length() > 0) ? pComplexTypArray->item(0).getAttributeArray() : NULL;
|
|
|
+ const CAttributeGroupArray *pAttributeGroupArray = (pComplexTypArray != nullptr && pComplexTypArray->length() > 0) ? pComplexTypArray->item(0).getAttributeGroupArray() : nullptr;
|
|
|
+ const CAttributeArray *pAttributeArray = (pComplexTypArray != nullptr && pComplexTypArray->length() > 0) ? pComplexTypArray->item(0).getAttributeArray() : nullptr;
|
|
|
|
|
|
if (this->getConstAncestorNode(3)->getNodeType() != XSD_SCHEMA && \
|
|
|
(this->hasChildElements() == true || \
|
|
|
(this->hasChildElements() == false && (static_cast<const CElementArray*>(this->getConstParentNode()))->anyElementsHaveMaxOccursGreaterThanOne() == false)/* || \
|
|
|
- (this->isTopLevelElement() == true && (pAttributeGroupArray != NULL || pAttributeArray != NULL))*/))
|
|
|
+ (this->isTopLevelElement() == true && (pAttributeGroupArray != nullptr || pAttributeArray != nullptr))*/))
|
|
|
|
|
|
{
|
|
|
return true;
|
|
@@ -391,21 +367,17 @@ bool CElement::isATab() const
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
-/* if (stricmp(this->getMaxOccurs(), TAG_UNBOUNDED) == 0)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
// Any element that is in sequence of complex type will be a tab
|
|
|
- else*/ if (this->getConstAncestorNode(3)->getNodeType() == XSD_SEQUENCE && this->getConstAncestorNode(3)->getNodeType() == XSD_COMPLEX_TYPE)
|
|
|
+ if (this->getConstAncestorNode(3)->getNodeType() == XSD_SEQUENCE && this->getConstAncestorNode(3)->getNodeType() == XSD_COMPLEX_TYPE)
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
- else if (/*this->getConstAncestorNode(3)->getNodeType == XSD_COMPLEX_TYPE &&*/ this->getConstAncestorNode(3)->getNodeType() == XSD_ELEMENT)
|
|
|
+ else if (this->getConstAncestorNode(3)->getNodeType() == XSD_ELEMENT)
|
|
|
{
|
|
|
const CElement *pElement = dynamic_cast<const CElement*>(this->getConstAncestorNode(3));
|
|
|
|
|
|
- assert(pElement != NULL);
|
|
|
- if (pElement != NULL)
|
|
|
+ assert(pElement != nullptr);
|
|
|
+ if (pElement != nullptr)
|
|
|
return pElement->isATab();
|
|
|
}
|
|
|
return false;
|
|
@@ -417,7 +389,7 @@ bool CElement::isLastTab(const int idx) const
|
|
|
|
|
|
const CElementArray *pElementArray = dynamic_cast<const CElementArray*>(this->getConstParentNode());
|
|
|
|
|
|
- if (pElementArray == NULL)
|
|
|
+ if (pElementArray == nullptr)
|
|
|
{
|
|
|
assert(!"Corrupt XSD??");
|
|
|
return false;
|
|
@@ -428,24 +400,20 @@ bool CElement::isLastTab(const int idx) const
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
void CElement::populateEnvXPath(::StringBuffer strXPath, unsigned int index)
|
|
|
{
|
|
|
assert(strXPath.length() > 0);
|
|
|
|
|
|
- //strXPath.append("/").append(this->getName()).append("[").append(index).append("]");
|
|
|
strXPath.append("[").append(index).append("]");
|
|
|
-
|
|
|
- //PROGLOG("Setting element to envpath of %s, previous path: %s", strXPath.str(), this->getEnvXPath());
|
|
|
this->setEnvXPath(strXPath);
|
|
|
|
|
|
CConfigSchemaHelper::getInstance()->getSchemaMapManager()->addMapOfXPathToElement(this->getEnvXPath(), this);
|
|
|
|
|
|
- if (m_pComplexTypeArray != NULL)
|
|
|
+ if (m_pComplexTypeArray != nullptr)
|
|
|
m_pComplexTypeArray->populateEnvXPath(strXPath, index);
|
|
|
- if (m_pSimpleType != NULL)
|
|
|
+ if (m_pSimpleType != nullptr)
|
|
|
m_pSimpleType->populateEnvXPath(strXPath, index);
|
|
|
- if (m_pKeyArray != NULL)
|
|
|
+ if (m_pKeyArray != nullptr)
|
|
|
m_pKeyArray->populateEnvXPath(strXPath, index);
|
|
|
}
|
|
|
|
|
@@ -454,7 +422,7 @@ void CElement::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
//PROGLOG("Mapping element with XPATH of %s to %p", this->getEnvXPath(), this);
|
|
|
//CConfigSchemaHelper::getInstance()->getSchemaMapManager()->addMapOfXPathToElement(this->getEnvXPath(), this);
|
|
|
|
|
|
- if (m_pComplexTypeArray != NULL)
|
|
|
+ if (m_pComplexTypeArray != nullptr)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -466,7 +434,7 @@ void CElement::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
// time to do validation?
|
|
|
}
|
|
|
}
|
|
|
- if (m_pSimpleType != NULL)
|
|
|
+ if (m_pSimpleType != nullptr)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -477,11 +445,11 @@ void CElement::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (m_pComplexTypeArray == NULL)
|
|
|
+ if (m_pComplexTypeArray == nullptr)
|
|
|
{
|
|
|
const char* pValue = pEnvTree->queryPropTree(this->getEnvXPath())->queryProp("");
|
|
|
|
|
|
- if (pValue != NULL)
|
|
|
+ if (pValue != nullptr)
|
|
|
{
|
|
|
this->setEnvValueFromXML(pValue);
|
|
|
CConfigSchemaHelper::getInstance()->appendElementXPath(this->getEnvXPath());
|
|
@@ -490,7 +458,7 @@ void CElement::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
|
|
|
const char* pInstanceName = pEnvTree->queryPropTree(this->getEnvXPath())->queryProp(XML_ATTR_NAME);
|
|
|
|
|
|
- if (pInstanceName != NULL && *pInstanceName != 0)
|
|
|
+ if (pInstanceName != nullptr && *pInstanceName != 0)
|
|
|
this->setInstanceName(pInstanceName);
|
|
|
}
|
|
|
|
|
@@ -501,20 +469,20 @@ bool CElement::isTopLevelElement() const
|
|
|
|
|
|
const char * CElement::getViewType() const
|
|
|
{
|
|
|
- if(m_pAnnotation != NULL && m_pAnnotation->getAppInfo() != NULL)
|
|
|
+ if(m_pAnnotation != nullptr && m_pAnnotation->getAppInfo() != nullptr)
|
|
|
return m_pAnnotation->getAppInfo()->getViewType();
|
|
|
- return NULL;
|
|
|
+ return nullptr;
|
|
|
}
|
|
|
|
|
|
void CElementArray::dump(::std::ostream &cout, unsigned int offset) const
|
|
|
{
|
|
|
offset+= STANDARD_OFFSET_1;
|
|
|
|
|
|
- QuickOutHeader(cout, XSD_ELEMENT_ARRAY_STR, offset);
|
|
|
+ quickOutHeader(cout, XSD_ELEMENT_ARRAY_STR, offset);
|
|
|
QUICK_OUT(cout, XSDXPath, offset);
|
|
|
QUICK_OUT(cout, EnvXPath, offset);
|
|
|
QUICK_OUT_ARRAY(cout, offset);
|
|
|
- QuickOutFooter(cout, XSD_ELEMENT_ARRAY_STR, offset);
|
|
|
+ quickOutFooter(cout, XSD_ELEMENT_ARRAY_STR, offset);
|
|
|
}
|
|
|
|
|
|
void CElementArray::getDocumentation(::StringBuffer &strDoc) const
|
|
@@ -525,7 +493,7 @@ void CElementArray::getDocumentation(::StringBuffer &strDoc) const
|
|
|
void CElementArray::getJSON(::StringBuffer &strJSON, unsigned int offset, int idx) const
|
|
|
{
|
|
|
offset += STANDARD_OFFSET_2;
|
|
|
- QuickOutPad(strJSON, offset);
|
|
|
+ quickOutPad(strJSON, offset);
|
|
|
|
|
|
int lidx = (idx == -1 ? 0 : idx);
|
|
|
|
|
@@ -534,7 +502,7 @@ void CElementArray::getJSON(::StringBuffer &strJSON, unsigned int offset, int id
|
|
|
(this->item(lidx)).getJSON(strJSON, offset+STANDARD_OFFSET_2, lidx);
|
|
|
|
|
|
offset += STANDARD_OFFSET_2;
|
|
|
- QuickOutPad(strJSON, offset);
|
|
|
+ quickOutPad(strJSON, offset);
|
|
|
strJSON.append("}");
|
|
|
}
|
|
|
|
|
@@ -542,10 +510,9 @@ void CElementArray::populateEnvXPath(::StringBuffer strXPath, unsigned int index
|
|
|
{
|
|
|
strXPath.appendf("/%s", this->item(0).getName());
|
|
|
this->setEnvXPath(strXPath);
|
|
|
-
|
|
|
- for (int idx=0; idx < this->length(); idx++)
|
|
|
+ int len = this->length();
|
|
|
+ for (int idx=0; idx < len; idx++)
|
|
|
{
|
|
|
- //strXPath.appendf("[%d]", idx+1);
|
|
|
this->item(idx).populateEnvXPath(strXPath.str(), idx+1);
|
|
|
CConfigSchemaHelper::stripXPathIndex(strXPath);
|
|
|
}
|
|
@@ -560,7 +527,7 @@ const char* CElementArray::getXML(const char* /*pComponent*/)
|
|
|
for (int idx = 0; idx < length; idx++)
|
|
|
{
|
|
|
CElement &Element = this->item(idx);
|
|
|
- m_strXML.append(Element.getXML(NULL));
|
|
|
+ m_strXML.append(Element.getXML(nullptr));
|
|
|
|
|
|
if (idx+1 < length)
|
|
|
m_strXML.append("\n");
|
|
@@ -576,28 +543,22 @@ void CElementArray::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
|
|
|
do
|
|
|
{
|
|
|
- CElement *pElement = NULL;
|
|
|
+ CElement *pElement = nullptr;
|
|
|
|
|
|
strEnvXPath.appendf("[%d]", subIndex);
|
|
|
if (pEnvTree->hasProp(strEnvXPath.str()) == false)
|
|
|
return;
|
|
|
|
|
|
if (subIndex == 1)
|
|
|
- {
|
|
|
pElement = CConfigSchemaHelper::getInstance()->getSchemaMapManager()->getElementFromXPath(strEnvXPath.str());
|
|
|
- }
|
|
|
else
|
|
|
{
|
|
|
pElement = CElement::load(this, this->getSchemaRoot(), this->getXSDXPath(), false);
|
|
|
this->append(*pElement);
|
|
|
}
|
|
|
|
|
|
- assert(pElement);
|
|
|
-
|
|
|
if (subIndex > 1)
|
|
|
- {
|
|
|
pElement->populateEnvXPath(this->getEnvXPath(), subIndex);
|
|
|
- }
|
|
|
|
|
|
pElement->setTopLevelElement(false);
|
|
|
pElement->loadXMLFromEnvXml(pEnvTree);
|
|
@@ -610,9 +571,9 @@ void CElementArray::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
|
|
|
CElementArray* CElementArray::load(const char* pSchemaFile)
|
|
|
{
|
|
|
- assert(pSchemaFile != NULL);
|
|
|
- if (pSchemaFile == NULL)
|
|
|
- return NULL;
|
|
|
+ assert(pSchemaFile != nullptr);
|
|
|
+ if (pSchemaFile == nullptr)
|
|
|
+ return nullptr;
|
|
|
|
|
|
typedef ::IPropertyTree jlibIPropertyTree;
|
|
|
::Linked<jlibIPropertyTree> pSchemaRoot;
|
|
@@ -621,22 +582,17 @@ CElementArray* CElementArray::load(const char* pSchemaFile)
|
|
|
schemaPath.appendf("%s%s", DEFAULT_SCHEMA_DIRECTORY, pSchemaFile);
|
|
|
pSchemaRoot.setown(createPTreeFromXMLFile(schemaPath.str()));
|
|
|
|
|
|
- CElementArray *pElemArray = CElementArray::load(NULL, pSchemaRoot, XSD_TAG_ELEMENT);
|
|
|
-
|
|
|
- //PROGLOG("Function: %s() at %s:%d", __func__, __FILE__, __LINE__);
|
|
|
- //PROGLOG("pElemArray = %p", pElemArray);
|
|
|
-
|
|
|
+ CElementArray *pElemArray = CElementArray::load(nullptr, pSchemaRoot, XSD_TAG_ELEMENT);
|
|
|
return pElemArray;
|
|
|
}
|
|
|
|
|
|
CElementArray* CElementArray::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath)
|
|
|
{
|
|
|
- assert(pSchemaRoot != NULL);
|
|
|
- if (pSchemaRoot == NULL)
|
|
|
- return NULL;
|
|
|
+ assert(pSchemaRoot != nullptr);
|
|
|
+ if (pSchemaRoot == nullptr)
|
|
|
+ return nullptr;
|
|
|
|
|
|
CElementArray *pElemArray = new CElementArray(pParentNode);
|
|
|
- assert(pElemArray != NULL);
|
|
|
|
|
|
pSchemaRoot->Link();
|
|
|
pElemArray->setSchemaRoot(pSchemaRoot);
|
|
@@ -652,49 +608,11 @@ CElementArray* CElementArray::load(CXSDNodeBase* pParentNode, const ::IPropertyT
|
|
|
SETPARENTNODE(pElemArray, pParentNode);
|
|
|
|
|
|
return pElemArray;
|
|
|
-
|
|
|
-
|
|
|
-/* typedef ::IPropertyTreeIterator jlibIPropertyTreeIterator;
|
|
|
- Owned<jlibIPropertyTreeIterator> elemIter = pSchemaRoot->getElements(xpath);
|
|
|
-
|
|
|
- CElement *pElem = CElement::load(pElemArray, pSchemaRoot, strXPathExt.str());
|
|
|
-
|
|
|
- assert(pElem);
|
|
|
- pElemArray->append(*pElem);
|
|
|
-
|
|
|
- SETPARENTNODE(pElemArray, pParentNode);
|
|
|
-
|
|
|
- return pElemArray;
|
|
|
-
|
|
|
- int count = 1;
|
|
|
-
|
|
|
- ForEach(*elemIter)
|
|
|
- {
|
|
|
- strXPathExt.set(xpath);
|
|
|
- strXPathExt.appendf("[%d]", count);
|
|
|
-
|
|
|
- CElement *pElem = CElement::load(pElemArray, pSchemaRoot, strXPathExt.str());
|
|
|
-
|
|
|
- assert(pElem);
|
|
|
- pElemArray->append(*pElem);
|
|
|
-
|
|
|
- count++;
|
|
|
- }
|
|
|
-
|
|
|
- if (pElemArray->length() == 0)
|
|
|
- {
|
|
|
- delete pElemArray;
|
|
|
- return NULL;
|
|
|
- }
|
|
|
-
|
|
|
- SETPARENTNODE(pElemArray, pParentNode);
|
|
|
-
|
|
|
- return pElemArray;*/
|
|
|
}
|
|
|
|
|
|
int CElementArray::getCountOfSiblingElements(const char *pXPath) const
|
|
|
{
|
|
|
- assert(pXPath != NULL && *pXPath != 0);
|
|
|
+ assert(pXPath != nullptr && *pXPath != 0);
|
|
|
|
|
|
int count = 0;
|
|
|
|
|
@@ -708,9 +626,12 @@ int CElementArray::getCountOfSiblingElements(const char *pXPath) const
|
|
|
|
|
|
const CXSDNodeBase* CElementArray::getNodeByTypeAndNameAscending(NODE_TYPES eNodeType, const char *pName) const
|
|
|
{
|
|
|
- assert(pName != NULL);
|
|
|
+ assert(pName != nullptr);
|
|
|
+ if (!pName || !*pName)
|
|
|
+ return nullptr;
|
|
|
|
|
|
- for (int idx = 1; idx < this->length() && eNodeType == XSD_ELEMENT; idx++)
|
|
|
+ int len = this->length();
|
|
|
+ for (int idx = 1; idx < len && eNodeType == XSD_ELEMENT; idx++)
|
|
|
{
|
|
|
if (strcmp ((static_cast<CElement>(this->item(idx))).getName(), pName) == 0)
|
|
|
return &(this->item(idx));
|
|
@@ -720,7 +641,7 @@ const CXSDNodeBase* CElementArray::getNodeByTypeAndNameAscending(NODE_TYPES eNod
|
|
|
|
|
|
const CXSDNodeBase* CElementArray::getNodeByTypeAndNameDescending(NODE_TYPES eNodeType, const char *pName) const
|
|
|
{
|
|
|
- assert(pName != NULL);
|
|
|
+ assert(pName != nullptr);
|
|
|
|
|
|
if (eNodeType == this->getNodeType())
|
|
|
return this;
|
|
@@ -730,33 +651,25 @@ const CXSDNodeBase* CElementArray::getNodeByTypeAndNameDescending(NODE_TYPES eNo
|
|
|
|
|
|
const CElement* CElementArray::getElementByNameAscending(const char *pName) const
|
|
|
{
|
|
|
- for (int idx = 1; idx < this->length() ;idx++)
|
|
|
+ int len = this->length();
|
|
|
+ for (int idx = 1; idx < len; idx++)
|
|
|
{
|
|
|
if (strcmp ((static_cast<CElement>(this->item(idx))).getName(), pName) == 0)
|
|
|
return &(this->item(idx));
|
|
|
}
|
|
|
|
|
|
assert(!("Control should not reach here, unknown pName?"));
|
|
|
- return NULL;
|
|
|
-}
|
|
|
-
|
|
|
-const CElement* CElementArray::getElementByNameDescending(const char *pName) const
|
|
|
-{
|
|
|
- for (int idx = 1; idx < this->length(); idx++)
|
|
|
- {
|
|
|
- if (strcmp ((static_cast<CElement>(this->item(idx))).getName(), pName) == 0)
|
|
|
- return &(this->item(idx));
|
|
|
- }
|
|
|
- return NULL;
|
|
|
+ return nullptr;
|
|
|
}
|
|
|
|
|
|
int CElementArray::getSiblingIndex(const char* pXSDXPath, const CElement* pElement)
|
|
|
{
|
|
|
- assert(pXSDXPath != NULL && *pXSDXPath != 0 && pElement != NULL);
|
|
|
+ assert(pXSDXPath != nullptr && *pXSDXPath != 0 && pElement != nullptr);
|
|
|
|
|
|
int nSiblingIndex = 0;
|
|
|
+ int len =this->length();
|
|
|
|
|
|
- for (int idx=0; idx < this->length(); idx++)
|
|
|
+ for (int idx=0; idx < len; idx++)
|
|
|
{
|
|
|
if (strcmp(this->item(idx).getXSDXPath(), pXSDXPath) == 0)
|
|
|
{
|
|
@@ -787,9 +700,9 @@ void CElement::setIsInXSD(bool b)
|
|
|
if (m_bIsInXSD == true)
|
|
|
{
|
|
|
CElementArray *pElemArray = dynamic_cast<CElementArray*>(this->getParentNode());
|
|
|
- assert(pElemArray != NULL);
|
|
|
+ assert(pElemArray != nullptr);
|
|
|
|
|
|
- if (pElemArray != NULL)
|
|
|
+ if (pElemArray != nullptr)
|
|
|
pElemArray->incCountOfElementsInXSD();
|
|
|
}
|
|
|
}
|
|
@@ -798,7 +711,7 @@ bool CElement::hasChildElements() const
|
|
|
{
|
|
|
const CComplexTypeArray* pComplexTypeArray = this->getComplexTypeArray();
|
|
|
|
|
|
- if (pComplexTypeArray != NULL && pComplexTypeArray->length() != 0)
|
|
|
+ if (pComplexTypeArray != nullptr && pComplexTypeArray->length() != 0)
|
|
|
{
|
|
|
int nLen = pComplexTypeArray->length();
|
|
|
|
|
@@ -814,15 +727,12 @@ bool CElement::hasChildElements() const
|
|
|
|
|
|
CArrayOfElementArrays* CArrayOfElementArrays::load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath)
|
|
|
{
|
|
|
- assert(pSchemaRoot != NULL);
|
|
|
- if (pSchemaRoot == NULL)
|
|
|
- return NULL;
|
|
|
+ assert(pSchemaRoot != nullptr);
|
|
|
+ if (pSchemaRoot == nullptr)
|
|
|
+ return nullptr;
|
|
|
|
|
|
CArrayOfElementArrays *pArrayOfElementArrays = new CArrayOfElementArrays(pParentNode);
|
|
|
|
|
|
- /*pSchemaRoot->Link();
|
|
|
- pArrayOfElementArrays->setSchemaRoot(pSchemaRoot);*/
|
|
|
-
|
|
|
::StringBuffer strXPathExt(xpath);
|
|
|
pArrayOfElementArrays->setXSDXPath(xpath);
|
|
|
|
|
@@ -838,7 +748,6 @@ CArrayOfElementArrays* CArrayOfElementArrays::load(CXSDNodeBase* pParentNode, co
|
|
|
|
|
|
CElementArray *pElemArray = CElementArray::load(pArrayOfElementArrays, pSchemaRoot, strXPathExt.str());
|
|
|
|
|
|
- assert(pElemArray);
|
|
|
pArrayOfElementArrays->append(*pElemArray);
|
|
|
|
|
|
count++;
|
|
@@ -849,7 +758,8 @@ CArrayOfElementArrays* CArrayOfElementArrays::load(CXSDNodeBase* pParentNode, co
|
|
|
|
|
|
void CArrayOfElementArrays::getDocumentation(::StringBuffer &strDoc) const
|
|
|
{
|
|
|
- for (int i = 0; i < this->length(); i++)
|
|
|
+ int len = this->length();
|
|
|
+ for (int i = 0; i < len; i++)
|
|
|
{
|
|
|
this->item(i).getDocumentation(strDoc);
|
|
|
}
|
|
@@ -861,7 +771,8 @@ void CArrayOfElementArrays::populateEnvXPath(::StringBuffer strXPath, unsigned i
|
|
|
CConfigSchemaHelper::stripXPathIndex(strCopy);
|
|
|
this->setEnvXPath(strCopy);
|
|
|
|
|
|
- for (int i = 0; i < this->length(); i++)
|
|
|
+ int len = this->length();
|
|
|
+ for (int i = 0; i < len; i++)
|
|
|
{
|
|
|
this->item(i).populateEnvXPath(strXPath.str());
|
|
|
CConfigSchemaHelper::getInstance()->getSchemaMapManager()->addMapOfXSDXPathToElementArray(this->item(i).getXSDXPath(), &(this->item(i)));
|
|
@@ -870,7 +781,8 @@ void CArrayOfElementArrays::populateEnvXPath(::StringBuffer strXPath, unsigned i
|
|
|
|
|
|
void CArrayOfElementArrays::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
{
|
|
|
- for (int i = 0; i < this->ordinality(); i++)
|
|
|
+ int len = this->ordinality();
|
|
|
+ for (int i = 0; i < len; i++)
|
|
|
{
|
|
|
this->item(i).loadXMLFromEnvXml(pEnvTree);
|
|
|
}
|
|
@@ -878,7 +790,8 @@ void CArrayOfElementArrays::loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
|
|
|
|
|
|
void CArrayOfElementArrays::getJSON(::StringBuffer &strJSON, unsigned int offset, int idx) const
|
|
|
{
|
|
|
- for (int i = 0; i < this->ordinality(); i++)
|
|
|
+ int len = this->ordinality();
|
|
|
+ for (int i = 0; i < len; i++)
|
|
|
{
|
|
|
if (i != 0)
|
|
|
strJSON.append(",\n");
|