| FFmpegKit Linux API 6.0

Loading...
Searching...
No Matches
ReturnCode.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Taner Sener
3 *
4 * This file is part of FFmpegKit.
5 *
6 * FFmpegKit is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * FFmpegKit is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General License
17 * along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include "ReturnCode.h"
21
22 bool ffmpegkit::ReturnCode::isSuccess(const std::shared_ptr<ffmpegkit::ReturnCode> value) {
23 return (value != nullptr) && (value->getValue() == Success);
24}
25
26 bool ffmpegkit::ReturnCode::isCancel(const std::shared_ptr<ffmpegkit::ReturnCode> value) {
27 return (value != nullptr) && (value->getValue() == Cancel);
28}
29
30 ffmpegkit::ReturnCode::ReturnCode(const int value) : _value {value} {
31}
32
33 int ffmpegkit::ReturnCode::getValue() const {
34 return _value;
35}
36
37 bool ffmpegkit::ReturnCode::isValueSuccess() const {
38 return (_value == Success);
39}
40
41 bool ffmpegkit::ReturnCode::isValueError() const {
42 return ((_value != Success) && (_value != Cancel));
43}
44
45 bool ffmpegkit::ReturnCode::isValueCancel() const {
46 return (_value == Cancel);
47}
48
49 namespace ffmpegkit {
50
51 std::ostream& operator<<(std::ostream& out, const std::shared_ptr<ffmpegkit::ReturnCode>& o) {
52 if (o == nullptr) {
53 return out;
54 } else {
55 return out << o->_value;
56 }
57 }
58
59}
ReturnCode.h
ffmpegkit::ReturnCode::isValueError
bool isValueError() const
Definition ReturnCode.cpp:41
ffmpegkit::ReturnCode::isCancel
static bool isCancel(const std::shared_ptr< ffmpegkit::ReturnCode > value)
Definition ReturnCode.cpp:26
ffmpegkit::ReturnCode::Success
static constexpr int Success
Definition ReturnCode.h:30
ffmpegkit::ReturnCode::isValueCancel
bool isValueCancel() const
Definition ReturnCode.cpp:45
ffmpegkit::ReturnCode::isSuccess
static bool isSuccess(const std::shared_ptr< ffmpegkit::ReturnCode > value)
Definition ReturnCode.cpp:22
ffmpegkit::ReturnCode::isValueSuccess
bool isValueSuccess() const
Definition ReturnCode.cpp:37
ffmpegkit::ReturnCode::getValue
int getValue() const
Definition ReturnCode.cpp:33
ffmpegkit::ReturnCode::ReturnCode
ReturnCode(const int value)
Definition ReturnCode.cpp:30
ffmpegkit
Definition AbstractSession.h:25
ffmpegkit::operator<<
std::ostream & operator<<(std::ostream &out, const std::shared_ptr< ffmpegkit::ReturnCode > &o)
Definition ReturnCode.cpp:51