ConfigEnv.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2018 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 _CONFIGENV_HPP_
  14. #define _CONFIGENV_HPP_
  15. #include "EnvHelper.hpp"
  16. #include "IConfigEnv.hpp"
  17. namespace ech
  18. {
  19. class configenv_decl ConfigEnv : public CInterface, implements IConfigEnv<IPropertyTree, StringBuffer>
  20. {
  21. public:
  22. ConfigEnv(IPropertyTree *config);
  23. ~ConfigEnv();
  24. IMPLEMENT_IINTERFACE;
  25. virtual void create(IPropertyTree *params);
  26. virtual unsigned add(IPropertyTree *params);
  27. virtual void modify(IPropertyTree *params);
  28. virtual void remove(IPropertyTree *params);
  29. virtual void runUpdateTasks(IPropertyTree *params);
  30. virtual const char* queryAttribute(const char *xpath);
  31. virtual void setAttribute(const char *xpath, const char* attrName, const char* attrValue);
  32. virtual void getContent(const char* xpath, StringBuffer& out, int format=XML_SortTags|XML_Format);
  33. virtual void addContent(const char* xpath, StringBuffer& in, int type=XML_Format);
  34. virtual bool isEnvironmentValid(StringBuffer& env);
  35. virtual IPropertyTree* getNode(const char *xpath);
  36. virtual IPropertyTree* getNode(unsigned id);
  37. virtual unsigned getNodeId(const char *xpath);
  38. virtual bool isAttributeValid(const char* xpath, const char* schema, const char* key, const char* value, bool src);
  39. private:
  40. EnvHelper * m_envHelper;
  41. };
  42. }
  43. #endif