2012-05-05 22:15:28 +04:00
|
|
|
/*
|
|
|
|
grive: an GPL program to sync a local directory with Google Drive
|
|
|
|
Copyright (C) 2012 Wan Wai Ho
|
|
|
|
|
|
|
|
This program 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 version 2
|
|
|
|
of the License.
|
|
|
|
|
|
|
|
This program 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 this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "JsonResponse.hh"
|
|
|
|
|
2012-05-05 22:21:39 +04:00
|
|
|
#include "protocol/Json.hh"
|
2012-05-05 22:15:28 +04:00
|
|
|
|
|
|
|
namespace gr { namespace http {
|
|
|
|
|
|
|
|
JsonResponse::JsonResponse()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-04-28 21:25:34 +04:00
|
|
|
std::size_t JsonResponse::Write( const char *data, std::size_t count )
|
2012-05-09 18:25:42 +04:00
|
|
|
{
|
2013-04-28 21:25:34 +04:00
|
|
|
return m_resp.Write( data, count ) ;
|
2012-05-09 18:25:42 +04:00
|
|
|
}
|
|
|
|
|
2013-04-28 21:25:34 +04:00
|
|
|
std::size_t JsonResponse::Read( char *data, std::size_t count )
|
2012-05-05 22:15:28 +04:00
|
|
|
{
|
2013-04-28 21:25:34 +04:00
|
|
|
return count ;
|
2012-05-05 22:15:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
Json JsonResponse::Response() const
|
|
|
|
{
|
|
|
|
return Json::Parse( m_resp.Response() ) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
} } // end of namespace
|