Item.h
Go to the documentation of this file.
1 /****
2  * Item.h
3  *
4  * Copyright 2019 mikee47 <mike@sillyhouse.net>
5  *
6  * This file is part of the Sming UPnP Library
7  *
8  * This library is free software: you can redistribute it and/or modify it under the terms of the
9  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with this library.
16  * If not, see <https://www.gnu.org/licenses/>.
17  *
18  ****/
19 
20 #pragma once
21 
22 #include <RapidXML.h>
23 
24 namespace UPnP
25 {
26 class Item;
27 class ItemEnumerator;
28 
32 enum class DescType {
33  header,
34  embedded,
35  content,
36 };
37 
38 class Item
39 {
40 public:
41  virtual ~Item()
42  {
43  }
44 
45  virtual XML::Node* getDescription(XML::Document& doc, DescType descType) const
46  {
47  return nullptr;
48  }
49 
50  virtual ItemEnumerator* getList(unsigned index, String& name)
51  {
52  return nullptr;
53  }
54 
55  virtual Item* next() const
56  {
57  return nullptr;
58  }
59 
60  bool operator==(const Item& other) const
61  {
62  return this == &other;
63  }
64 };
65 
66 } // namespace UPnP
The String class.
Definition: WString.h:137
Definition: ItemEnumerator.h:30
Definition: Item.h:39
virtual XML::Node * getDescription(XML::Document &doc, DescType descType) const
Definition: Item.h:45
virtual ItemEnumerator * getList(unsigned index, String &name)
Definition: Item.h:50
bool operator==(const Item &other) const
Definition: Item.h:60
virtual Item * next() const
Definition: Item.h:55
virtual ~Item()
Definition: Item.h:41
Definition: ActionRequest.h:25
DescType
When building descriptions this qualifies what information is required.
Definition: Item.h:32
@ header
Description template with main document element.
@ embedded
Details for embedded device or service.
@ content
Full details for this device or service.
rapidxml::xml_node< char > Node
Definition: RapidXML.h:37
rapidxml::xml_document< char > Document
Definition: RapidXML.h:36