Shaka Player Embedded
attr.h
Go to the documentation of this file.
1 // Copyright 2018 Google LLC
2 //
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 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SHAKA_EMBEDDED_JS_DOM_ATTR_H_
16 #define SHAKA_EMBEDDED_JS_DOM_ATTR_H_
17 
18 #include <string>
19 
20 #include "shaka/optional.h"
21 #include "src/js/dom/node.h"
22 
23 namespace shaka {
24 namespace js {
25 namespace dom {
26 
27 class Document;
28 class Element;
29 
34 class Attr final : public Node {
35  DECLARE_TYPE_INFO(Attr);
36 
37  public:
40  optional<std::string> namespace_prefix, const std::string& value);
41 
44  const std::string local_name;
45  const bool specified = true;
46  std::string value;
47 
49 
50  std::string attr_name() const;
51 
52  void Trace(memory::HeapTracer* tracer) const override;
53 
54  std::string node_name() const override;
55  optional<std::string> NodeValue() const override;
56  optional<std::string> TextContent() const override;
57 };
58 
59 class AttrFactory : public BackingObjectFactory<Attr, Node> {
60  public:
61  AttrFactory();
62 };
63 
64 } // namespace dom
65 } // namespace js
66 } // namespace shaka
67 
68 #endif // SHAKA_EMBEDDED_JS_DOM_ATTR_H_
void Trace(memory::HeapTracer *tracer) const override
Definition: attr.cc:46
optional< std::string > NodeValue() const override
Definition: attr.cc:55
const optional< std::string > namespace_prefix
Definition: attr.h:43
const std::string local_name
Definition: attr.h:44
RefPtr< Document > document() const
Definition: node.cc:47
std::string value
Definition: attr.h:46
optional< std::string > TextContent() const override
Definition: attr.cc:59
std::string node_name() const override
Definition: attr.cc:51
const bool specified
Definition: attr.h:45
std::string attr_name() const
Definition: attr.cc:40
const Member< Element > owner_element
Definition: attr.h:48
const optional< std::string > namespace_uri
Definition: attr.h:42
Attr(RefPtr< Document > document, RefPtr< Element > owner, const std::string &local_name, optional< std::string > namespace_uri, optional< std::string > namespace_prefix, const std::string &value)
Definition: attr.cc:24