SchemaSimpleContent.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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_SIMPLECONTENT_HPP_
  14. #define _SCHEMA_SIMPLECONTENT_HPP_
  15. #include "SchemaCommon.hpp"
  16. namespace CONFIGURATOR
  17. {
  18. class CRestriction;
  19. class CExtension;
  20. class CAnnotation;
  21. class CSimpleContent : public CXSDNode
  22. {
  23. GETTERSETTER(ID)
  24. public:
  25. virtual ~CSimpleContent();
  26. bool checkConstraint(const char *pValue) const;
  27. const CRestriction* getRestriction() const
  28. {
  29. return m_pRestriction;
  30. }
  31. const CAnnotation* getAnnotation() const
  32. {
  33. return m_pAnnotation;
  34. }
  35. const CExtension* getExtension() const
  36. {
  37. return m_pExtension;
  38. }
  39. virtual void dump(::std::ostream& cout, unsigned int offset = 0) const
  40. {
  41. UNIMPLEMENTED;
  42. }
  43. virtual void getDocumentation(StringBuffer &strDoc) const
  44. {
  45. UNIMPLEMENTED;
  46. }
  47. virtual const char* getXML(const char* /*pComponent*/)
  48. {
  49. UNIMPLEMENTED;
  50. return NULL;
  51. }
  52. virtual void populateEnvXPath(StringBuffer strXPath, unsigned int index = 1)
  53. {
  54. UNIMPLEMENTED;
  55. }
  56. virtual void loadXMLFromEnvXml(const IPropertyTree *pEnvTree)
  57. {
  58. UNIMPLEMENTED;
  59. }
  60. static CSimpleContent* load(CXSDNodeBase* pParentNode, const IPropertyTree *pSchemaRoot, const char* xpath);
  61. protected:
  62. CRestriction *m_pRestriction;
  63. CAnnotation *m_pAnnotation;
  64. CExtension *m_pExtension;
  65. private:
  66. CSimpleContent(CXSDNodeBase* pParentNode = NULL, const char* pID = NULL) : CXSDNode::CXSDNode(pParentNode, XSD_SIMPLE_CONTENT), m_strID(pID), m_pRestriction(NULL),
  67. m_pAnnotation(NULL), m_pExtension(NULL)
  68. {
  69. }
  70. };
  71. }
  72. #endif // _SCHEMA_SIMPLECONTENT_HPP_