Shaka Player Embedded
shaka
include
shaka
error.h
Go to the documentation of this file.
1
// Copyright 2016 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_ERROR_H_
16
#define SHAKA_EMBEDDED_ERROR_H_
17
18
#include <iostream>
19
#include <memory>
20
#include <string>
21
22
#include "
macros.h
"
23
24
namespace
shaka
{
25
34
class
SHAKA_EXPORT
Error
final {
35
public
:
37
Error
(
const
std::string&
message
);
39
Error
(
int
severity,
int
category,
int
code,
const
std::string& message);
40
41
Error
(
const
Error
&);
42
Error
(
Error
&&);
43
~
Error
();
44
45
Error
& operator=(
const
Error
&);
46
Error
& operator=(
Error
&&);
47
48
49
// TODO: Consider adding the data field. Or consider adding a PrintError
50
// method to print it without requiring the app to depend on V8.
51
53
std::string
message
;
58
int
severity
;
63
int
category
;
68
int
code
;
69
70
private
:
71
class
Impl
;
72
std::unique_ptr<Impl> impl_;
73
};
74
75
inline
std::ostream&
operator<<
(std::ostream& os,
const
Error
& error) {
76
return
os << error.
message
;
77
}
78
79
}
// namespace shaka
80
81
#endif // SHAKA_EMBEDDED_ERROR_H_
shaka::Error::code
int code
Definition:
error.h:68
SHAKA_EXPORT
#define SHAKA_EXPORT
Definition:
macros.h:30
shaka::Error::category
int category
Definition:
error.h:63
shaka::Error::message
std::string message
Definition:
error.h:53
shaka
Definition:
async_results.h:25
shaka::Error::severity
int severity
Definition:
error.h:58
shaka::operator<<
std::ostream & operator<<(std::ostream &os, const Error &error)
Definition:
error.h:75
shaka::Error::Impl
Definition:
error.cc:21
macros.h
message
const char * message
Definition:
dom_exception.cc:36
shaka::Error
Definition:
error.h:34
Generated by
1.8.13