SchemaChoice.hpp 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef _SCHEMA_CHOICE_HPP_
  14. #define _SCHEMA_CHOICE_HPP_
  15. #include "SchemaCommon.hpp"
  16. #include "jstring.hpp"
  17. namespace CONFIGURATOR
  18. {
  19. class CArrayOfElementArrays;
  20. class CChoice : public CXSDNode
  21. {
  22. public:
  23. virtual ~CChoice()
  24. {
  25. }
  26. GETTERSETTER(MaxOccurs)
  27. GETTERSETTER(MinOccurs)
  28. GETTERSETTER(ID)
  29. virtual void dump(::std::ostream &cout, unsigned int offset = 0) const;
  30. virtual void getDocumentation(::StringBuffer &strDoc) const;
  31. virtual void getJSON(::StringBuffer &strJSON, int idx = -1) const;
  32. virtual const char* getXML(const char* /*pComponent*/);
  33. virtual void populateEnvXPath(::StringBuffer strXPath, unsigned int index = 1);
  34. virtual void loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree);
  35. static CChoice* load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath);
  36. protected:
  37. CChoice(CXSDNodeBase* pParentNode, CArrayOfElementArrays *pArrayOfElemArrays = NULL) : CXSDNode::CXSDNode(pParentNode, XSD_CHOICE), m_pArrayOfElementArrays(pArrayOfElemArrays)
  38. {
  39. }
  40. CArrayOfElementArrays *m_pArrayOfElementArrays;
  41. private:
  42. CChoice() : CXSDNode::CXSDNode(NULL, XSD_CHOICE)
  43. {
  44. }
  45. };
  46. }
  47. #endif // _SCHEMA_CHOICE_HPP_