File: MyXml.h

package info (click to toggle)
p7zip 9.20.1~dfsg.1-4.1%2Bdeb8u3
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 13,368 kB
  • sloc: cpp: 104,670; ansic: 12,930; makefile: 1,899; sh: 1,031; asm: 159
file content (40 lines) | stat: -rw-r--r-- 756 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// MyXml.h

#ifndef __MYXML_H
#define __MYXML_H

#include "MyString.h"

struct CXmlProp
{
  AString Name;
  AString Value;
};

class CXmlItem
{
  bool ParseItems(const AString &s, int &pos, int numAllowedLevels);

public:
  AString Name;
  bool IsTag;
  CObjectVector<CXmlProp> Props;
  CObjectVector<CXmlItem> SubItems;

  bool ParseItem(const AString &s, int &pos, int numAllowedLevels);
  
  bool IsTagged(const AString &tag) const;
  int FindProperty(const AString &propName) const;
  AString GetPropertyValue(const AString &propName) const;
  AString GetSubString() const;
  int FindSubTag(const AString &tag) const;
  AString GetSubStringForTag(const AString &tag) const;
};

struct CXml
{
  CXmlItem Root;
  bool Parse(const AString &s);
};

#endif