Separatista
branchelement.h
1 /***************************************************************************
2 * Copyright (C) 2014 by Okkel Klaver *
3 * info@vanhetland.nl *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 
21 #ifndef SEPARATISTA_BRANCHELEMENT_H
22 #define SEPARATISTA_BRANCHELEMENT_H
23 
24 #include <string>
25 #include <map>
26 #include <iterator>
27 
28 #include "separatista/separatista.h"
29 #include "separatista/xerces_types.h"
30 #include "separatista/element.h"
31 
32 namespace Separatista
33 {
37  class SEPARATISTA_EXTERN BranchElement : public Element
38  {
39  public:
43  static Element* createElement(const ChildElementDescriptor* pChildElementDescriptor);
44 
45  IOErrorCode toDOMDocument(xercesc::DOMDocument *pDocument, xercesc::DOMElement *pParent, const ErrorOptions errorOptions = ThrowExceptions) const;
46 
47  void fromDOMDocument(xercesc::DOMElement *pDOMElement, const ErrorOptions errorOptions = ThrowExceptions);
48 
50  Element* getElementByTag(const wchar_t *pTagName, size_t nIndex = 0) const;
51 
53  Element* createElementByTag(const wchar_t *pTagName, size_t nIndex = 0);
54 
56  TagKeyRange getAllByTagName(const wchar_t *pTagName);
57 
59  void destroyElement(Element *pElement);
60 
61  protected:
62  BranchElement(const ChildElementDescriptor *pChildElementDescriptor);
63 
64  ~BranchElement();
65 
66  private:
67  TagKeyMap m_childElements;
68  };
69 }
70 #endif // SEPARATISTA_BRANCHELEMENT_H
Definition: elementdescriptor.h:58
ErrorOptions
Definition: element.h:62
Definition: mt940s.h:39
Definition: element.h:231
Definition: branchelement.h:37
Definition: element.h:55