SchemaInclude.hpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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_INCLUDE_HPP_
  14. #define _SCHEMA_INCLUDE_HPP_
  15. #include "jstring.hpp"
  16. #include "jarray.hpp"
  17. #include "SchemaCommon.hpp"
  18. namespace CONFIGURATOR
  19. {
  20. class CSchema;
  21. class CInclude : public CXSDNode
  22. {
  23. public:
  24. virtual ~CInclude()
  25. {
  26. }
  27. virtual void dump(::std::ostream& cout, unsigned int offset = 0) const;
  28. virtual void getDocumentation(StringBuffer &strDoc) const;
  29. virtual const char* getXML(const char* /*pComponent*/);
  30. virtual void populateEnvXPath(StringBuffer strXPath, unsigned int index = 1);
  31. GETTERSETTER(SchemaLocation)
  32. const CSchema* getIncludeSchema() const
  33. {
  34. return m_pIncludedSchema;
  35. }
  36. static CInclude* load(CXSDNodeBase* pParentNode, const IPropertyTree *pSchemaRoot, const char* xpath = NULL);
  37. protected:
  38. CInclude(CXSDNodeBase* pParentNode, const char* pSchemaLocation = NULL) : CXSDNode::CXSDNode(pParentNode, XSD_INCLUDE), m_strSchemaLocation(pSchemaLocation)
  39. {
  40. }
  41. CSchema *m_pIncludedSchema;
  42. void setIncludedSchema(CSchema *pSchema)
  43. {
  44. m_pIncludedSchema = pSchema;
  45. }
  46. private:
  47. CInclude(CXSDNodeBase* pParentNode = NULL) : CXSDNode::CXSDNode(pParentNode, XSD_INCLUDE), m_pIncludedSchema(NULL)
  48. {
  49. }
  50. };
  51. class CKevinArray
  52. {
  53. public:
  54. CKevinArray()
  55. {
  56. }
  57. virtual ~CKevinArray()
  58. {
  59. }
  60. char* load(/*CXSDNodeBase* pParentNode*/const ::IPropertyTree *pSchemaRoot, const char * p )
  61. {
  62. return nullptr;
  63. }
  64. };
  65. class CIncludeArray : public CIArrayOf<CInclude>, public CInterface, public CXSDNodeBase
  66. {
  67. public:
  68. CIncludeArray(CXSDNodeBase* pParentNode, IPropertyTree *pSchemaRoot) : CXSDNodeBase::CXSDNodeBase(pParentNode, XSD_INCLUDE_ARRAY), m_pSchemaRoot(pSchemaRoot)
  69. {
  70. }
  71. virtual ~CIncludeArray()
  72. {
  73. }
  74. virtual void dump(::std::ostream &cout, unsigned int offset = 0) const;
  75. virtual void getDocumentation(StringBuffer &strDoc) const;
  76. virtual void populateEnvXPath(StringBuffer strXPath, unsigned int index = 1);
  77. virtual const char* getXML(const char* /*pComponent*/);
  78. static CIncludeArray* load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath);
  79. protected:
  80. IPropertyTree *m_pSchemaRoot;
  81. private:
  82. CIncludeArray(CXSDNodeBase* pParentNode = NULL) : CXSDNodeBase::CXSDNodeBase(pParentNode, XSD_INCLUDE_ARRAY)
  83. {
  84. }
  85. };
  86. }
  87. #endif // _SCHEMA_INCLUDE_HPP_