Skip to content
Snippets Groups Projects
restrequest.cpp 3.35 KiB
Newer Older
/********************************************************************************************
 *                                                                                          *
 * Copyright (C) 2017 Armin Felder, Dennis Beier                                            *
 * This file is part of RocketChatMobileEngine <https://git.fairkom.net/chat/fairchat>.     *
 *                                                                                          *
 * RocketChatMobileEngine is free software: you can redistribute it and/or modify           *
 * it under the terms of the GNU General Public License as published by                     *
 * the Free Software Foundation, either version 3 of the License, or                        *
 * (at your option) any later version.                                                      *
 *                                                                                          *
 * RocketChatMobileEngine is distributed in the hope that it will be useful,                *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of                           *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                            *
 * GNU General Public License for more details.                                             *
 *                                                                                          *
 * You should have received a copy of the GNU General Public License                        *
 * along with RocketChatMobileEngine. If not, see <http://www.gnu.org/licenses/>.           *
 *                                                                                          *
 ********************************************************************************************/



Armin Felder's avatar
Armin Felder committed
#include "restrequest.h"

Armin Felder's avatar
as  
Armin Felder committed
RestRequest::RestRequest( QByteArray pData, QString pPath, RestRequest::methods pMethod, RestRequestCallback pSuccess ):
    mContent( std::move( pData ) ), mPath( std::move( pPath ) ), mMethod( pMethod ), mSuccess( std::move( pSuccess ) )
Armin Felder's avatar
Armin Felder committed
{
}

Armin Felder's avatar
as  
Armin Felder committed
RestRequest::RestRequest( QByteArray pData, QString pPath, RestRequest::methods pMethod, RestRequestCallback pSuccess, RestRequestCallback pError ):
    mContent( std::move( pData ) ), mPath( std::move( pPath ) ), mMethod( pMethod ), mSuccess( std::move( pSuccess ) ), mError( std::move( pError ) )
Armin Felder's avatar
Armin Felder committed
{
}

RestRequest::methods RestRequest::getMethod() const
{
    return mMethod;
}

void RestRequest::setMethod( const methods &pValue )
Armin Felder's avatar
Armin Felder committed
{
    mMethod = pValue;
}

QString RestRequest::getPath() const
{
    return mPath;
}

void RestRequest::setPath( const QString &pValue )
Armin Felder's avatar
Armin Felder committed
{
    mPath = pValue;
}

QByteArray RestRequest::getContent() const
{
    return mContent;
}

void RestRequest::setContent( const QByteArray &pValue )
Armin Felder's avatar
Armin Felder committed
{
    mContent = pValue;
}

RestRequestCallback RestRequest::getSuccess() const
{
    return mSuccess;
}

void RestRequest::setSuccess( const RestRequestCallback &pValue )
Armin Felder's avatar
Armin Felder committed
{
    mSuccess = pValue;
}

RestRequestCallback RestRequest::getError() const
{
    return mError;
}

void RestRequest::setError( const RestRequestCallback &pValue )
Armin Felder's avatar
Armin Felder committed
{
    mError = pValue;
}

bool RestRequest::getAbsolutePath() const
{
    return mAbsolutePath;
}

QString RestRequest::getMimeType() const
{
    return mMimeType;
}

void RestRequest::setMimeType( const QString &pValue )
Armin Felder's avatar
Armin Felder committed
{
    mMimeType = pValue;
}

bool RestRequest::isRawData()
{
    return mRawData;
}